Commit 42a38785 authored by Hans Dedecker's avatar Hans Dedecker

interface-ip: fix possible null pointer dereference

Reported by Coverity in CID 1445749
Signed-off-by: default avatarHans Dedecker <dedeckeh@gmail.com>
parent c1964d8e
......@@ -353,11 +353,11 @@ interface_ip_add_neighbor(struct interface *iface, struct blob_attr *attr, bool
ip = &iface->proto_ip;
neighbor = calloc(1,sizeof(*neighbor));
neighbor->flags = v6 ? DEVADDR_INET6 : DEVADDR_INET4;
if (!neighbor)
return;
neighbor->flags = v6 ? DEVADDR_INET6 : DEVADDR_INET4;
if ((cur = tb[NEIGHBOR_ADDRESS]) != NULL){
if (!inet_pton(af, blobmsg_data(cur), &neighbor->addr))
goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment