diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2019-07-16 11:41:16 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2019-07-16 11:42:45 +0200 |
commit | 7c942bffdd21f52ad6273c73d5bd2868283f3c42 (patch) | |
tree | ca4a30f49671fc7d60b578a857ca8f24be19d6dc /luci2 | |
parent | e452ca693af5278ff2ddc69b6f8ed0f346c98fb1 (diff) | |
download | luci2-ui-7c942bffdd21f52ad6273c73d5bd2868283f3c42.tar.gz |
uci_load() does not guarantee setting passed pointer to NULL on error.
It could result in using uninitialized pointed & crash.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'luci2')
-rw-r--r-- | luci2/src/rpcd/luci2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/luci2/src/rpcd/luci2.c b/luci2/src/rpcd/luci2.c index c8ef9bf..7c37144 100644 --- a/luci2/src/rpcd/luci2.c +++ b/luci2/src/rpcd/luci2.c @@ -217,7 +217,7 @@ rpc_luci2_system_log(struct ubus_context *ctx, struct ubus_object *obj, int logsize = 0; const char *logfile = NULL; struct stat st; - struct uci_package *p; + struct uci_package *p = NULL; struct uci_element *e; struct uci_section *s; struct uci_ptr ptr = { .package = "system" }; @@ -1235,7 +1235,7 @@ static FILE * dnsmasq_leasefile(void) { FILE *leases = NULL; - struct uci_package *p; + struct uci_package *p = NULL; struct uci_element *e; struct uci_section *s; struct uci_ptr ptr = { |