|
|
ab5f7c |
From: Guy Harris <guy@alum.mit.edu>
|
|
|
ab5f7c |
Date: Wed, 1 Jan 2014 23:24:27 +0000
|
|
|
ab5f7c |
Subject: [PATCH] Copy over r54544 from trunk:
|
|
|
ab5f7c |
|
|
|
ab5f7c |
------------------------------------------------------------------------
|
|
|
ab5f7c |
r54544 | guy | 2014-01-01 15:22:53 -0800 (Wed, 01 Jan 2014) | 11 lines
|
|
|
ab5f7c |
|
|
|
ab5f7c |
If the uncompression buffers are empty, they have no data; set the count
|
|
|
ab5f7c |
of bytes in them to 0, as there's no data in them, and set the offset in
|
|
|
ab5f7c |
that buffer of the stream's current position, to 0, as we're currently
|
|
|
ab5f7c |
at the beginning of the file in both streams.
|
|
|
ab5f7c |
|
|
|
ab5f7c |
This fixes some tricky-to-reproduce errors (which show up only if the
|
|
|
ab5f7c |
ngsniffer_t structure is allocated from data that's been allocated,
|
|
|
ab5f7c |
written to in those variables, and freed).
|
|
|
ab5f7c |
|
|
|
ab5f7c |
svn path=/trunk-1.10/; revision=54545
|
|
|
ab5f7c |
|
|
|
ab5f7c |
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
|
|
|
ab5f7c |
index 92e451d..096ee00 100644
|
|
|
ab5f7c |
--- a/wiretap/ngsniffer.c
|
|
|
ab5f7c |
+++ b/wiretap/ngsniffer.c
|
|
|
ab5f7c |
@@ -740,7 +740,11 @@ ngsniffer_open(wtap *wth, int *err, gchar **err_info)
|
|
|
ab5f7c |
|
|
|
ab5f7c |
/* We haven't allocated any uncompression buffers yet. */
|
|
|
ab5f7c |
ngsniffer->seq.buf = NULL;
|
|
|
ab5f7c |
+ ngsniffer->seq.nbytes = 0;
|
|
|
ab5f7c |
+ ngsniffer->seq.nextout = 0;
|
|
|
ab5f7c |
ngsniffer->rand.buf = NULL;
|
|
|
ab5f7c |
+ ngsniffer->rand.nbytes = 0;
|
|
|
ab5f7c |
+ ngsniffer->rand.nextout = 0;
|
|
|
ab5f7c |
|
|
|
ab5f7c |
/* Set the current file offset; the offset in the compressed file
|
|
|
ab5f7c |
and in the uncompressed data stream currently the same. */
|