From: Olof Sivertsson Date: Wed, 3 Jan 2018 09:35:13 +0000 (+0100) Subject: proto: allow dumping protocol handlers without config_params X-Git-Url: http://git.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 proto: allow dumping protocol handlers without config_params When ubus invokes proto_dump_handlers, and a struct proto_handler has been added with a NULL config_params, a segmentation fault occurs. Avoid this segmentation fault by checking for a NULL config_params before further access. Signed-off-by: Olof Sivertsson --- diff --git a/proto.c b/proto.c index 9eb31c5..6047735 100644 --- a/proto.c +++ b/proto.c @@ -591,7 +591,7 @@ proto_dump_handlers(struct blob_buf *b) void *v; c = blobmsg_open_table(b, p->name); - if (p->config_params->validate) { + if (p->config_params && p->config_params->validate) { int i; v = blobmsg_open_table(b, "validate");