diff options
author | AndersBroman <anders.broman@ericsson.com> | 2016-11-11 14:33:08 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-11-11 16:05:52 +0000 |
commit | e723a899c009a6167d8e6eaab83cd76adfa2d246 (patch) | |
tree | db6b55557270217cf23cd0637580e3f0ff239bc5 /epan/tvbuff.c | |
parent | 20adb7a564cf29a027d59f9dc92f4a81eaf4108d (diff) |
[tvbuff] Fix tvb_find_guint16() searched_bytes is from
start_offset(offset) and the while loop should be on searched_bytes.
Change-Id: I62343f7cb04f9110f773ba1ada8dbcbfbd262861
Reviewed-on: https://code.wireshark.org/review/18741
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 38ac3e06e6..80edf629d0 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1919,7 +1919,7 @@ tvb_find_guint16(tvbuff_t *tvb, const gint offset, const gint maxlength, return -1; } - searched_bytes = offset1 - pos + 1; + searched_bytes = offset - pos + 1; if ((maxlength != -1) && (searched_bytes >= maxlength)) { return -1; @@ -1937,7 +1937,7 @@ tvb_find_guint16(tvbuff_t *tvb, const gint offset, const gint maxlength, } pos = offset1 + 1; - } while (pos < maxlength); + } while (searched_bytes < maxlength); return -1; } |