aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-08-25 19:14:59 -0400
committerAnders Broman <a.broman58@gmail.com>2015-08-27 04:34:10 +0000
commit0af048b7e40ee92d6702df873cbc515ae2eff9c8 (patch)
treef980825d5b37ce5c5d322b149c122b0704edd6ff /epan/dissectors/packet-x11.c
parent374439daa17fe2692746857b920616354ce658e7 (diff)
Remove calls of tvb_ensure_length_remaining.
The remaining calls seem to fall into 3 categories: 1. passing it to tvb_find_line_end when -1 (for length) will do. 2. duplicating the checking of tvb_reported_length_remaining, which is already in use near the tvb_ensure_length_remaining call. 3. Those that (probably) need tvb_ensure_capture_length_remaining Change-Id: I1e77695251e055644bcbbb89f3c181c65d1671ca Reviewed-on: https://code.wireshark.org/review/10268 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r--epan/dissectors/packet-x11.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index 7710f7b720..da36203796 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -4505,15 +4505,7 @@ static void dissect_x11_requests(tvbuff_t *tvb, packet_info *pinfo,
int length;
tvbuff_t *volatile next_tvb;
- while (tvb_reported_length_remaining(tvb, offset) != 0) {
- /*
- * We use "tvb_ensure_length_remaining()" to make sure there
- * actually *is* data remaining.
- *
- * This means we're guaranteed that "length_remaining" is
- * positive.
- */
- length_remaining = tvb_ensure_length_remaining(tvb, offset);
+ while ((length_remaining = tvb_reported_length_remaining(tvb, offset)) > 0) {
/*
* Can we do reassembly?
@@ -4854,16 +4846,7 @@ dissect_x11_replies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
byte_order = guess_byte_ordering(tvb, pinfo, state);
offset = 0;
- while (tvb_reported_length_remaining(tvb, offset) != 0) {
- /*
- * We use "tvb_ensure_length_remaining()" to make sure there
- * actually *is* data remaining.
- *
- * This means we're guaranteed that "length_remaining" is
- * positive.
- */
- length_remaining = tvb_ensure_length_remaining(tvb, offset);
-
+ while ((length_remaining = tvb_reported_length_remaining(tvb, offset)) > 0) {
/*
* Can we do reassembly?
*/