diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-01-17 17:53:38 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-01-17 19:12:45 +0000 |
commit | b87a5af633e109225f4e37ac741db4a990162d54 (patch) | |
tree | 6e9e10a119bdb87fcc2422abfb1bd3883b0a0989 /epan/tvbuff.c | |
parent | 96d585a5e9baef21e1eea8505d78305b034dc80e (diff) |
Fix build [-Werror=maybe-uninitialized]
Found building with GCC 5.3.0 and CFLAGS="-g -Og".
Change-Id: I5bc29b6e91cc98332a513c9d03b02d2f6906608d
Reviewed-on: https://code.wireshark.org/review/13362
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 681fedc35a..12378e6441 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -457,7 +457,7 @@ tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset) guint tvb_ensure_captured_length_remaining(const tvbuff_t *tvb, const gint offset) { - guint abs_offset, rem_length; + guint abs_offset = 0, rem_length = 0; int exception; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -682,7 +682,7 @@ tvb_offset_from_real_beginning(const tvbuff_t *tvb) static inline const guint8* ensure_contiguous_no_exception(tvbuff_t *tvb, const gint offset, const gint length, int *pexception) { - guint abs_offset, abs_length; + guint abs_offset = 0, abs_length = 0; int exception; exception = check_offset_length_no_exception(tvb, offset, length, &abs_offset, &abs_length); @@ -761,7 +761,7 @@ fast_ensure_contiguous(tvbuff_t *tvb, const gint offset, const guint length) void * tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, size_t length) { - guint abs_offset, abs_length; + guint abs_offset = 0, abs_length = 0; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -819,7 +819,7 @@ tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, size_t length) void * tvb_memdup(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, size_t length) { - guint abs_offset, abs_length; + guint abs_offset = 0, abs_length = 0; void *duped; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -1859,8 +1859,8 @@ gint tvb_find_guint8(tvbuff_t *tvb, const gint offset, const gint maxlength, const guint8 needle) { const guint8 *result; - guint abs_offset; - guint limit; + guint abs_offset = 0; + guint limit = 0; int exception; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -1921,8 +1921,8 @@ tvb_ws_mempbrk_pattern_guint8(tvbuff_t *tvb, const gint offset, const gint maxle const ws_mempbrk_pattern* pattern, guchar *found_needle) { const guint8 *result; - guint abs_offset; - guint limit; + guint abs_offset = 0; + guint limit = 0; int exception; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -1963,7 +1963,7 @@ tvb_ws_mempbrk_pattern_guint8(tvbuff_t *tvb, const gint offset, const gint maxle guint tvb_strsize(tvbuff_t *tvb, const gint offset) { - guint abs_offset, junk_length; + guint abs_offset = 0, junk_length; gint nul_offset; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -2021,7 +2021,7 @@ gint tvb_strnlen(tvbuff_t *tvb, const gint offset, const guint maxlength) { gint result_offset; - guint abs_offset, junk_length; + guint abs_offset = 0, junk_length; DISSECTOR_ASSERT(tvb && tvb->initialized); @@ -2929,8 +2929,8 @@ static gint _tvb_get_nstringz(tvbuff_t *tvb, const gint offset, const guint bufsize, guint8* buffer, gint *bytes_copied) { gint stringlen; - guint abs_offset; - gint limit, len; + guint abs_offset = 0; + gint limit, len = 0; gboolean decreased_max = FALSE; /* Only read to end of tvbuff, w/o throwing exception. */ @@ -3499,7 +3499,7 @@ gchar *tvb_bytes_to_str(wmem_allocator_t *allocator, tvbuff_t *tvb, gint tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const gint haystack_offset) { - guint haystack_abs_offset, haystack_abs_length; + guint haystack_abs_offset = 0, haystack_abs_length = 0; const guint8 *haystack_data; const guint8 *needle_data; const guint needle_len = needle_tvb->length; |