diff options
author | Michael Scott <michael.scott@linaro.org> | 2017-01-23 15:00:57 -0800 |
---|---|---|
committer | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2017-02-03 15:59:16 +0200 |
commit | f6255a78ae35eceb36b821c938cd13a92a4853ad (patch) | |
tree | da8f9b5f5b835db1cdd1ea7d810d3338335c8c73 /samples | |
parent | 359ef02bdf2557372a8884177142ca039a2bd2c0 (diff) |
samples: net: irc_bot: fix null pointer deref
samples/net/irc_bot/src/irc-bot.c:368:36:
warning: 'c' may be used uninitialized in this function
[-Wmaybe-uninitialized]
for (cc = &chan->irc->chans, c = c->irc->chans;
^
As suggested by Leandro Pereira <leandro.pereira@intel.com>
adjusted to:
for (cc = &chan->irc->chans, c = chan->irc->chans;
Change-Id: Icd490059e0b97f95408dd7bad3f1783a215c5edb
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/net/irc_bot/src/irc-bot.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/net/irc_bot/src/irc-bot.c b/samples/net/irc_bot/src/irc-bot.c index 8683a274f..0b669535e 100644 --- a/samples/net/irc_bot/src/irc-bot.c +++ b/samples/net/irc_bot/src/irc-bot.c @@ -364,7 +364,7 @@ zirc_chan_part(struct zirc_chan *chan) return ret; } - for (cc = &chan->irc->chans, c = c->irc->chans; + for (cc = &chan->irc->chans, c = chan->irc->chans; c; cc = &c->next, c = c->next) { if (c == chan) { *cc = c->next; |