From: Felix Fietkau Date: Sat, 19 Apr 2014 09:58:16 +0000 (+0200) Subject: ubus: check the l3_dev pointer before dereferencing it X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ede9739fe90f5da09f14481d10a4f11c000072de;p=oweals%2Fnetifd.git ubus: check the l3_dev pointer before dereferencing it Signed-off-by: Felix Fietkau --- diff --git a/ubus.c b/ubus.c index 5cb54b1..aeb864f 100644 --- a/ubus.c +++ b/ubus.c @@ -650,7 +650,8 @@ netifd_dump_status(struct interface *iface) if (iface->state == IFS_UP) { time_t cur = system_get_rtime(); blobmsg_add_u32(&b, "uptime", cur - iface->start_time); - blobmsg_add_string(&b, "l3_device", iface->l3_dev.dev->ifname); + if (iface->l3_dev.dev) + blobmsg_add_string(&b, "l3_device", iface->l3_dev.dev->ifname); } if (iface->proto_handler)