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>
This commit is contained in:
Jukka Rissanen 2017-04-18 20:33:58 +03:00
commit 7ce82fea82

View file

@ -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;
}