summaryrefslogtreecommitdiff
path: root/subsys
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2017-04-18 20:33:58 +0300
committerJukka Rissanen <jukka.rissanen@linux.intel.com>2017-04-21 14:19:49 +0300
commit7ce82fea8290a063ca6619abeee4badb5797341e (patch)
tree06ebcdaa78bdafe0c5379aaaf163286c1226f311 /subsys
parent651a0cb2691915c40960681fb9a076ffc07baff7 (diff)
net: ipv6: Make sure not to access null pointer
While very unlikely it might happen that fragment pointer is NULL when going through fragment list. Coverity-CID: 167148 Change-Id: Ic3dbed7ee29c7b864d4830d726f65d7f62dcea84 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Diffstat (limited to 'subsys')
-rw-r--r--subsys/net/ip/ipv6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c
index 95ef6b723..9bb23e95d 100644
--- a/subsys/net/ip/ipv6.c
+++ b/subsys/net/ip/ipv6.c
@@ -554,7 +554,7 @@ int net_ipv6_find_last_ext_hdr(struct net_buf *buf)
}
out:
- if (pos > frag->len) {
+ if (!frag || pos > frag->len) {
pos = -EINVAL;
}