Skip to content
Snippets Groups Projects
Commit e3165b49 authored by Oleg Hahm's avatar Oleg Hahm
Browse files

gnrc: avoid potential null pointer dereferencing

parent 9922d260
No related branches found
No related tags found
No related merge requests found
......@@ -364,7 +364,9 @@ static inline void _addr_set_multicast(uint8_t *dst, ng_pktsnip_t *payload)
case NG_NETTYPE_IPV6:
dst[0] = 0x33;
dst[1] = 0x33;
memcpy(dst + 2, ((uint8_t *)payload->data) + _IPV6_DST_OFFSET, 4);
if ((payload != NULL) && (payload->data != NULL)) {
memcpy(dst + 2, ((uint8_t *)payload->data) + _IPV6_DST_OFFSET, 4);
}
/* TODO change to proper types when ng_ipv6_hdr_t got merged */
break;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment