summaryrefslogtreecommitdiff
path: root/extcap
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2017-03-22 11:43:43 +0100
committerAnders Broman <a.broman58@gmail.com>2017-03-23 04:48:23 +0000
commitbb017f3eb30804645a84ccc4cd071fac44d0a326 (patch)
treea01b244d58c0c7170d67d5c4e4403d1b5afa8913 /extcap
parentc9bf21cbcaf5f79360015c4edcb65f23300a39d7 (diff)
downloadwireshark-bb017f3eb30804645a84ccc4cd071fac44d0a326.tar.gz
androiddump: Fix tcpdump op prec bug with used_buffer_length calc
androiddump reads data from tcpdump in chunks that not necessarily match packet sizes. Whenever a partly read packet is found in buffers more data is read and the number of used bytes in buffer is updated. The calculation of used_buffer_length is wrong though leading to most packets are read and thrown away. Problem fixed by correcting an operator precedence mistake where used_buffer_length would only be increaded with 0 or 1 insted of actual number of read bytes. Change-Id: Ib5c4e1d96e7ba499f26796ffa5d7ce6a116b9a6e Reviewed-on: https://code.wireshark.org/review/20666 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 'extcap')
-rw-r--r--extcap/androiddump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index 0954596e44..7b57b5a63a 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -2644,7 +2644,7 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo,
return EXIT_CODE_GENERIC;
}
- if (used_buffer_length += length > 1) {
+ if ((used_buffer_length += length) > 1) {
break;
}
}