* [PATCH 1/2] Fix use of uninitialized variable @ 2010-02-02 22:08 Gustavo F. Padovan 2010-02-02 22:08 ` [PATCH 2/2] Remove dead assignments at gatchat Gustavo F. Padovan 2010-02-02 22:33 ` [PATCH 1/2] Fix use of uninitialized variable Denis Kenzior 0 siblings, 2 replies; 4+ messages in thread From: Gustavo F. Padovan @ 2010-02-02 22:08 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 498 bytes --] --- gatchat/gatchat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index e25bfd6..5b0851b 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -692,7 +692,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, unsigned char *buf; GAtChat *chat = data; GIOError err; - gsize rbytes; + gsize rbytes = 0; gsize toread; gsize total_read = 0; guint read_count = 0; -- 1.6.4.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Remove dead assignments at gatchat 2010-02-02 22:08 [PATCH 1/2] Fix use of uninitialized variable Gustavo F. Padovan @ 2010-02-02 22:08 ` Gustavo F. Padovan 2010-02-02 22:32 ` Denis Kenzior 2010-02-02 22:33 ` [PATCH 1/2] Fix use of uninitialized variable Denis Kenzior 1 sibling, 1 reply; 4+ messages in thread From: Gustavo F. Padovan @ 2010-02-02 22:08 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 2034 bytes --] --- gatchat/gatchat.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 5b0851b..d5362db 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -312,7 +312,6 @@ static gboolean g_at_chat_match_notify(GAtChat *chat, char *line) { GHashTableIter iter; struct at_notify *notify; - char *prefix; gpointer key, value; gboolean ret = FALSE; GAtResult result; @@ -322,7 +321,6 @@ static gboolean g_at_chat_match_notify(GAtChat *chat, char *line) result.final_or_pdu = 0; while (g_hash_table_iter_next(&iter, &key, &value)) { - prefix = key; notify = value; if (!g_str_has_prefix(line, key)) @@ -753,7 +751,7 @@ static void wakeup_cb(gboolean ok, GAtResult *result, gpointer user_data) static gboolean wakeup_no_response(gpointer user) { GAtChat *chat = user; - struct at_command *cmd = g_queue_peek_head(chat->command_queue); + struct at_command *cmd; if (chat->debugf) chat->debugf("Wakeup got no response\n", chat->debug_data); @@ -1259,7 +1257,6 @@ gboolean g_at_chat_unregister(GAtChat *chat, guint id) { GHashTableIter iter; struct at_notify *notify; - char *prefix; gpointer key, value; GSList *l; @@ -1269,7 +1266,6 @@ gboolean g_at_chat_unregister(GAtChat *chat, guint id) g_hash_table_iter_init(&iter, chat->notify_list); while (g_hash_table_iter_next(&iter, &key, &value)) { - prefix = key; notify = value; l = g_slist_find_custom(notify->nodes, GUINT_TO_POINTER(id), @@ -1294,7 +1290,6 @@ gboolean g_at_chat_unregister_all(GAtChat *chat) { GHashTableIter iter; struct at_notify *notify; - char *prefix; gpointer key, value; GSList *l; @@ -1304,7 +1299,6 @@ gboolean g_at_chat_unregister_all(GAtChat *chat) g_hash_table_iter_init(&iter, chat->notify_list); while (g_hash_table_iter_next(&iter, &key, &value)) { - prefix = key; notify = value; for (l = notify->nodes; l; l = l->next) -- 1.6.4.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Remove dead assignments at gatchat 2010-02-02 22:08 ` [PATCH 2/2] Remove dead assignments at gatchat Gustavo F. Padovan @ 2010-02-02 22:32 ` Denis Kenzior 0 siblings, 0 replies; 4+ messages in thread From: Denis Kenzior @ 2010-02-02 22:32 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 507 bytes --] Hi Gustavo, > --- > gatchat/gatchat.c | 8 +------- > 1 files changed, 1 insertions(+), 7 deletions(-) So I applied this patch with one minor change: > @@ -753,7 +751,7 @@ static void wakeup_cb(gboolean ok, GAtResult *result, > gpointer user_data) static gboolean wakeup_no_response(gpointer user) > { > GAtChat *chat = user; > - struct at_command *cmd = g_queue_peek_head(chat->command_queue); > + struct at_command *cmd; This part was no longer necessary. Regards, -Denis ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Fix use of uninitialized variable 2010-02-02 22:08 [PATCH 1/2] Fix use of uninitialized variable Gustavo F. Padovan 2010-02-02 22:08 ` [PATCH 2/2] Remove dead assignments at gatchat Gustavo F. Padovan @ 2010-02-02 22:33 ` Denis Kenzior 1 sibling, 0 replies; 4+ messages in thread From: Denis Kenzior @ 2010-02-02 22:33 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 676 bytes --] Hi Gustavo, > --- > gatchat/gatchat.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c > index e25bfd6..5b0851b 100644 > --- a/gatchat/gatchat.c > +++ b/gatchat/gatchat.c > @@ -692,7 +692,7 @@ static gboolean received_data(GIOChannel *channel, > GIOCondition cond, unsigned char *buf; > GAtChat *chat = data; > GIOError err; > - gsize rbytes; > + gsize rbytes = 0; > gsize toread; > gsize total_read = 0; > guint read_count = 0; > I'm convinced that this is a false positive. The read_count keeps rbytes from ever being referenced when undefined. Regards, -Denis ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-02 22:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-02 22:08 [PATCH 1/2] Fix use of uninitialized variable Gustavo F. Padovan 2010-02-02 22:08 ` [PATCH 2/2] Remove dead assignments at gatchat Gustavo F. Padovan 2010-02-02 22:32 ` Denis Kenzior 2010-02-02 22:33 ` [PATCH 1/2] Fix use of uninitialized variable Denis Kenzior
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox