summaryrefslogtreecommitdiff
path: root/proto.c
diff options
context:
space:
mode:
authorOlof Sivertsson <osivertsson@gmail.com>2018-01-03 10:35:13 +0100
committerHans Dedecker <dedeckeh@gmail.com>2018-01-03 16:57:43 +0100
commitfd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 (patch)
tree43284fc76e287fa992d3af5a8dd9e82c4056ad94 /proto.c
parent4268193c90bdd1532ee0555dd109a43eb8524b04 (diff)
downloadnetifd-fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1.tar.gz
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 <olof.sivertsson@zenterio.com>
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c2
1 files changed, 1 insertions, 1 deletions
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");