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-01-31 13:45:53 +0200 |
commit | a8aa5e75eef8bd38613a3aa976a5cdf56dd07374 (patch) | |
tree | b241e945eb3322f7b9174b93082b79f7da82d1cc | |
parent | 9fbe11b3c9760cecf4572dbf202682bd884f1954 (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>
-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; |