diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-08-09 15:43:42 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-08-09 15:43:42 +0000 |
commit | 031593742723cb0876498da4a86c65992604656a (patch) | |
tree | 590f55b659e5fd90818c7550ee7b513fc8fa5f04 /epan/dissectors/packet-csn1.c | |
parent | 56a7831d2addf053c5a4f6a0f07d31928d72bd95 (diff) |
Fix the fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6139 :
Properly initialize the CSN_DESCR type before recursively calling
csnStreamDissector().
svn path=/trunk/; revision=38430
Diffstat (limited to 'epan/dissectors/packet-csn1.c')
-rw-r--r-- | epan/dissectors/packet-csn1.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-csn1.c b/epan/dissectors/packet-csn1.c index b01fd61f07..122b65897c 100644 --- a/epan/dissectors/packet-csn1.c +++ b/epan/dissectors/packet-csn1.c @@ -195,7 +195,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t if (remaining_bits_len > 0) { pui8 = pui8DATA(data, pDescr->offset); - + *pui8 = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_text(tree, tvb, bit_offset>>3, 1, "%s %s", decode_bits_in_field(bit_offset, 1, tvb_get_bits8(tvb, bit_offset, 1)), @@ -454,7 +454,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t if (no_of_bits > 0) { - + if (no_of_bits <= 32) { proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s", @@ -470,8 +470,8 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t else { return ProcessError(tree, tvb, bit_offset,"csnStreamDissector NOT IMPLEMENTED", 999, pDescr); - } - + } + remaining_bits_len -= no_of_bits; DISSECTOR_ASSERT(remaining_bits_len >= 0); bit_offset += no_of_bits; @@ -531,7 +531,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t proto_tree *test_tree; descr[0] = pChoice->descr; - descr[1].type = CSN_END; + descr[0].type = CSN_END; pui8 = pui8DATA(data, pDescr->offset); *pui8 = i; proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s Choice: %s", |