From ede9739fe90f5da09f14481d10a4f11c000072de Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 19 Apr 2014 11:58:16 +0200 Subject: [PATCH] ubus: check the l3_dev pointer before dereferencing it Signed-off-by: Felix Fietkau --- ubus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.30.2