diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-08-23 11:50:51 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-08-23 18:51:25 +0000 |
commit | f4ad204745e6ccbb0ae420561b8e159dc4a3a824 (patch) | |
tree | cb8a8e412a46ec18b6202069c48afa629036d9b5 /epan | |
parent | 3479406d6f9841bcf5d70b0c3b84354dcbf3742d (diff) |
Remove now-redundant check.
We now check much earlier for an invalid message length; remove the
check done afterwards.
Also, note that dissect_netlink_error() should also check the message
length, to make sure it doesn't run past the end of the message, and
indicate why we are assuming an "integer" is 4 bytes (it's because the
RFC is vague here).
Change-Id: Ie0b5074acc852cdeaa008fee1125130a6c8771a1
Reviewed-on: https://code.wireshark.org/review/17279
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-netlink.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-netlink.c b/epan/dissectors/packet-netlink.c index a50d32c179..09a41a2cbb 100644 --- a/epan/dissectors/packet-netlink.c +++ b/epan/dissectors/packet-netlink.c @@ -355,7 +355,15 @@ dissect_netlink_hdr(tvbuff_t *tvb, proto_tree *tree, int offset, int encoding, g static void dissect_netlink_error(tvbuff_t *tvb, proto_tree *tree, int offset, int encoding) { - /* Assume sizeof(int) == 4. */ + /* + * XXX - this should make sure we don't run past the end of the + * message. + */ + + /* + * Assume sizeof(int) == 4; RFC 3549 doesn't say "32 bits", it + * says "integer (typically 32 bits)". + */ proto_tree_add_item(tree, &hfi_netlink_error, tvb, offset, 4, encoding); offset += 4; @@ -450,9 +458,6 @@ dissect_netlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_data if (!dissector_try_uint_new(netlink_dissector_table, protocol, next_tvb, pinfo, fh_msg, TRUE, &data)) call_data_dissector(next_tvb, pinfo, fh_msg); - } else if (pkt_len != 16) { - /* XXX, expert info */ - break; } offset = pkt_end_offset; |