aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-04-20 11:01:16 +0200
committerAnders Broman <a.broman58@gmail.com>2018-04-20 10:48:26 +0000
commit1a9f3b8f6d65b50c0eaa78bde29ca50708900178 (patch)
treece8872d6dcb1597e95b463c9c695e9511612cb49
parent89ff4070c0d0524c3502d56745d9dfcc0cb8706d (diff)
tvbuff: fix compilation with gcc-4.
../epan/tvbuff.c: In function 'tvb_new_octet_aligned': ../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] *rem_len = tvb->length - *offset_ptr; ^ ../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here guint abs_offset, rem_length; ^ ../epan/tvbuff.c: In function 'tvb_find_line_end': ../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] *rem_len = tvb->length - *offset_ptr; ^ ../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here guint abs_offset, rem_length; ^ ../epan/tvbuff.c: In function 'tvb_find_line_end_unquoted': ../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] *rem_len = tvb->length - *offset_ptr; ^ ../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here guint abs_offset, rem_length; Change-Id: Iba9fe31ac5fcf604d65bbf3bceef0c09004c1b6c Reviewed-on: https://code.wireshark.org/review/27050 Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/tvbuff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index d890f34aac..cc5ba3af95 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -483,7 +483,7 @@ tvb_captured_length(const tvbuff_t *tvb)
static inline gint
_tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset)
{
- guint abs_offset, rem_length;
+ guint abs_offset = 0, rem_length;
int exception;
exception = compute_offset_and_remaining(tvb, offset, &abs_offset, &rem_length);