aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-01-17 17:53:38 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-01-17 19:12:45 +0000
commitb87a5af633e109225f4e37ac741db4a990162d54 (patch)
tree6e9e10a119bdb87fcc2422abfb1bd3883b0a0989
parent96d585a5e9baef21e1eea8505d78305b034dc80e (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>
-rw-r--r--epan/dissectors/packet-bthci_evt.c2
-rw-r--r--epan/dissectors/packet-btsmp.c5
-rw-r--r--epan/dissectors/packet-iec104.c1
-rw-r--r--epan/dissectors/packet-selfm.c2
-rw-r--r--epan/tvbuff.c26
-rw-r--r--ui/gtk/rtp_player.c2
-rw-r--r--wiretap/logcat.c2
7 files changed, 21 insertions, 19 deletions
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index 8c5650e9fa..7cf68a5bda 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -3949,7 +3949,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
wmem_list_t *opcode_list;
wmem_list_frame_t *opcode_list_frame;
bthci_cmd_data_t *lastest_bthci_cmd_data = NULL;
- opcode_list_data_t *opcode_list_data;
+ opcode_list_data_t *opcode_list_data = NULL;
guint32 opcode = G_MAXUINT32;
/* Reject the packet if data is NULL */
diff --git a/epan/dissectors/packet-btsmp.c b/epan/dissectors/packet-btsmp.c
index 6b53daea41..5cdc4b2181 100644
--- a/epan/dissectors/packet-btsmp.c
+++ b/epan/dissectors/packet-btsmp.c
@@ -190,6 +190,8 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
guint32 adapter_id;
gint previous_proto;
+ interface_id = HCI_INTERFACE_DEFAULT;
+ adapter_id = HCI_ADAPTER_DEFAULT;
previous_proto = (GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_frame_prev(wmem_list_tail(pinfo->layers)))));
if (data && previous_proto == proto_btl2cap) {
btl2cap_data_t *l2cap_data;
@@ -199,9 +201,6 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
interface_id = l2cap_data->interface_id;
adapter_id = l2cap_data->adapter_id;
}
- } else {
- interface_id = HCI_INTERFACE_DEFAULT;
- adapter_id = HCI_ADAPTER_DEFAULT;
}
ti = proto_tree_add_item(tree, proto_btsmp, tvb, 0, tvb_captured_length(tvb), ENC_NA);
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index 4c1500d185..dae39e3b2e 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -1394,6 +1394,7 @@ static int dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
res = wmem_strbuf_new_label(wmem_packet_scope());
+ Start = 0;
for (Off = 0; Off <= TcpLen - 2; Off++) {
Start = tvb_get_guint8(tvb, Off);
if (Start == APCI_START) {
diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c
index 50afd4a1c4..4342721bf0 100644
--- a/epan/dissectors/packet-selfm.c
+++ b/epan/dissectors/packet-selfm.c
@@ -1232,7 +1232,7 @@ dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
gfloat ai_sf_fp;
gboolean config_found = FALSE;
fm_conversation *conv;
- fm_config_frame *cfg_data;
+ fm_config_frame *cfg_data = NULL;
len = tvb_get_guint8(tvb, offset);
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;
diff --git a/ui/gtk/rtp_player.c b/ui/gtk/rtp_player.c
index 45f34c7b7c..3503f10634 100644
--- a/ui/gtk/rtp_player.c
+++ b/ui/gtk/rtp_player.c
@@ -1879,7 +1879,7 @@ play_channels(void)
PaHostApiIndex default_host_api_index = Pa_GetDefaultHostApi();
PaHostApiIndex host_api_index;
- const PaHostApiInfo *host_api_info;
+ const PaHostApiInfo *host_api_info = NULL;
for (host_api_index=0; host_api_index<host_api_count; host_api_index++)
{
diff --git a/wiretap/logcat.c b/wiretap/logcat.c
index a20c5bd2d9..54b87a3033 100644
--- a/wiretap/logcat.c
+++ b/wiretap/logcat.c
@@ -107,6 +107,8 @@ static gint detect_version(FILE_T fh, int *err, gchar **err_info)
entry_len = sizeof(*log_entry_v2) + payload_length;
if (hdr_size != sizeof(*log_entry_v2))
continue;
+ } else {
+ continue;
}
if (!wtap_read_bytes(fh, buffer + read_sofar, entry_len - read_sofar, err, err_info)) {