summaryrefslogtreecommitdiff
path: root/wiretap/ngsniffer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-01-01 23:22:53 +0000
committerGuy Harris <guy@alum.mit.edu>2014-01-01 23:22:53 +0000
commit492883cbf1887c9a113356bdc3afdaf92c338e82 (patch)
treea56681a104e84410aaa25ec056d7aa0cd28311ee /wiretap/ngsniffer.c
parentf878016d6bbd8fe91e57a408c7327ea200967c71 (diff)
downloadwireshark-492883cbf1887c9a113356bdc3afdaf92c338e82.tar.gz
If the uncompression buffers are empty, they have no data; set the count
of bytes in them to 0, as there's no data in them, and set the offset in that buffer of the stream's current position, to 0, as we're currently at the beginning of the file in both streams. This fixes some tricky-to-reproduce errors (which show up only if the ngsniffer_t structure is allocated from data that's been allocated, written to in those variables, and freed). #BACKPORT 1.8, 1.10 svn path=/trunk/; revision=54544
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r--wiretap/ngsniffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 9c18623504..c41da046f5 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -740,7 +740,11 @@ ngsniffer_open(wtap *wth, int *err, gchar **err_info)
/* We haven't allocated any uncompression buffers yet. */
ngsniffer->seq.buf = NULL;
+ ngsniffer->seq.nbytes = 0;
+ ngsniffer->seq.nextout = 0;
ngsniffer->rand.buf = NULL;
+ ngsniffer->rand.nbytes = 0;
+ ngsniffer->rand.nextout = 0;
/* Set the current file offset; the offset in the compressed file
and in the uncompressed data stream currently the same. */