X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fndp.c;h=bd620682954a20bd69151ced5e3f3967feb3c70d;hp=89bcd3c98af43fc92958fc8f055f45e6ff3e926e;hb=0b68cabeb40d6e24a677a9332d3f3db163b5d723;hpb=47bcdec8bd3bea91ef0510cdef7702bd559e8369;ds=sidebyside diff --git a/src/ndp.c b/src/ndp.c index 89bcd3c..bd62068 100644 --- a/src/ndp.c +++ b/src/ndp.c @@ -160,10 +160,19 @@ int setup_ndp_interface(struct interface *iface, bool enable) if (iface->static_ndp_len) { char *entry = alloca(iface->static_ndp_len), *saveptr; + if (!entry) { + syslog(LOG_ERR, "Alloca failed for static NDP list"); + return -1; + } memcpy(entry, iface->static_ndp, iface->static_ndp_len); for (entry = strtok_r(entry, " ", &saveptr); entry; entry = strtok_r(NULL, " ", &saveptr)) { struct ndp_neighbor *n = malloc(sizeof(*n)); + if (!n) { + syslog(LOG_ERR, "Malloc failed for static NDP-prefix %s", entry); + return -1; + } + n->iface = iface; n->timeout = 0;