Skip to content

Commit dc41aad

Browse files
jukkarnashif
authored andcommitted
tests: net: mld: Check null ptr dereference
If pkt allocation fails, then prepare to handle NULL pointer. Coverity-CID: 195844 Fixes #14405 Signed-off-by: Jukka Rissanen <[email protected]>
1 parent e509cdc commit dc41aad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/net/mld/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ static void send_query(struct net_if *iface)
327327
/* router alert opt + icmpv6 reserved space + mldv2 mcast record */
328328
pkt = net_pkt_alloc_with_buffer(iface, 144, AF_INET6,
329329
IPPROTO_ICMPV6, K_FOREVER);
330+
zassert_not_null(pkt, "Cannot allocate pkt");
330331

331332
net_pkt_set_ipv6_hop_limit(pkt, 1); /* RFC 3810 ch 7.4 */
332333
net_ipv6_create_new(pkt, &peer_addr, &dst);

0 commit comments

Comments
 (0)