alljoyn: more robust signature handling

There were two bugs in the handling of all-joyn struct signatures:
 - we were advancing the pointer without decrementing the length remaining
 - we were not checking for the string's null-terminator (which is only
   necessary if the string is malformed, but that's entirely possible)

Bug: 11028
Change-Id: I38b98cf3f43681f709846e3cb9068d20c4fdce82
Reviewed-on: https://code.wireshark.org/review/7552
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Evan Huus 2015-03-05 22:52:28 -05:00 committed by Michael Mann
parent ebc47e4cde
commit 9c2b593dc8
1 changed files with 3 additions and 1 deletions

View File

@ -1237,9 +1237,11 @@ parse_arg(tvbuff_t *tvb,
add_padding_item(padding_start, offset, tvb, tree);
(*signature)++; /* Advance past the '(' or '{'. */
(*signature_length)--;
/* *signature should never be NULL but just make sure to avoid potential issues. */
while(*signature && **signature != type_stop && tvb_reported_length_remaining(tvb, offset) > 0) {
while(*signature && **signature && **signature != type_stop
&& tvb_reported_length_remaining(tvb, offset) > 0) {
offset = parse_arg(tvb,
pinfo,
header_item,