diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-05-12 13:45:14 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-05-12 21:50:11 +0000 |
commit | 87deef63c6a7471258b33573717bba885b24527a (patch) | |
tree | 0f4a9716f7bf175a0e8a791922dc5b6eed79faa8 /epan/dissectors/packet-isis-clv.c | |
parent | beed21b038683377efb7b5c13b36a3a35fa720a2 (diff) |
Clean up some things.
Have separate expert info items for the PDU length field being too
short, the PDU length field being too long, a CLV being too short, and a
CLV being too long.
Do the PDU length checks when we add the PDU length field, and add the
expert infos to the length item; remember the results of the checks for
future use.
Use DISSECTOR_ASSERT for the tests in osi_check_and_get_checksum() that
make sure the checksum field is contained within the data to be
checksummed, so that's reported as a dissector bug to the user.
That means that osi_check_and_get_checksum() only returns FALSE if we
don't have all the data available to checksum; that already gets
reported as an indication that the checksum is unverified, so we don't
need to put confusing and misleading expert infos about the PDU
length - whatever PDU length errors need to be reported have already
been reported, as per the above.
Make expert info names more consistent, and fix one expert info variable
name.
Make the length argument to isis_dissect_clvs() unsigned.
Clean up white space.
Change-Id: I0ce799c766dc427602d155c5b48099df8bf51c67
Reviewed-on: https://code.wireshark.org/review/33179
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-isis-clv.c')
-rw-r--r-- | epan/dissectors/packet-isis-clv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c index 77b9402d24..20f957d8a1 100644 --- a/epan/dissectors/packet-isis-clv.c +++ b/epan/dissectors/packet-isis-clv.c @@ -481,7 +481,7 @@ isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int hf_nlpid, int offset */ void isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, - const isis_clv_handle_t *opts, expert_field* expert_short_len, int len, int id_length, + const isis_clv_handle_t *opts, expert_field* expert_short_len, guint len, int id_length, int unknown_tree_id _U_, int tree_type, int tree_length, expert_field ei_unknown) { guint8 code; @@ -489,7 +489,7 @@ isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offse int q; proto_tree *clv_tree; - while ( len > 0 ) { + while ( len != 0 ) { code = tvb_get_guint8(tvb, offset); offset += 1; len -= 1; |