Skip to content

Commit

Permalink
coap_address.c: Check for NULL ptr in is_bcast()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdeep1 authored and Jon Shallow committed Sep 12, 2023
1 parent 1db8eda commit 317b9b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coap_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ coap_is_bcast(const coap_address_t *a) {
last_refresh = now;
ife = ifa;
while (ife && bcst_cnt < COAP_BCST_CNT) {
if (ife->ifa_addr->sa_family == AF_INET &&
if (ife->ifa_addr && ife->ifa_addr->sa_family == AF_INET &&
ife->ifa_flags & IFF_BROADCAST) {
b_ipv4[bcst_cnt].s_addr = ((struct sockaddr_in *)ife->ifa_broadaddr)->sin_addr.s_addr;
bcst_cnt++;
Expand Down

0 comments on commit 317b9b7

Please sign in to comment.