aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-07-25 18:37:18 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-07-25 18:37:18 +0000
commitd58c13c363a502aeba33e28474fbb39611d35559 (patch)
tree1213e92fa401dd854ba0816e6bdcd58c5ece4036 /epan/proto.c
parenta92ee76d3ebea81a44737047c4646a19e986f6f7 (diff)
As pointed out in https://www.wireshark.org/lists/wireshark-dev/201307/msg00153.html :
The fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290 needs to allow for giving a length of -1 for FT_STRINGZ's. This is another fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8960 (in addition to r50836). There's no point in reverting that revision, though, since there was no need to use a length of -1 in that case. svn path=/trunk/; revision=50892
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c
index ae5d632c70..a79e4b8fa9 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1793,7 +1793,14 @@ test_length(header_field_info *hfinfo, proto_tree *tree, tvbuff_t *tvb,
else {
size += n;
}
+ } else if (hfinfo->type == FT_STRINGZ) {
+ /* If we're fetching until the end of the TVB, only validate
+ * that the offset is within range.
+ */
+ if (length == -1)
+ size = 0;
}
+
tvb_ensure_bytes_exist(tvb, start, size);
}