diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-11-08 16:24:14 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-11-16 09:15:28 +0900 |
commit | f3d752178cc84799e0d364ac657b3240d6e9f801 (patch) | |
tree | 6a68bb65c58d7696700f2f8aa9a6666613f62ce5 /etc | |
parent | 2599aef3bf6f8f278f6b17c6f671025ba8df0ff5 (diff) |
packet/icmp: Avoid TypeError when calculating length
Currently, ICMPv4 packet instance without its payload, it will raise
TypeError when calculating packet length, because the default value of
"data" field (payload data) is None and len() can not be applied against
None type object.
This patch changes the default value of "data" to the empty binary
value and confirms the value type of "data" field before serialization.
Also, this patch applies the same improvements to ICMPv6 packet library.
Reported-by: William Fisher <william.w.fisher@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions