From: Rafał Miłecki Date: Tue, 16 Jul 2019 09:41:16 +0000 (+0200) Subject: luci2: initialize package pointers to NULL X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=HEAD;hp=e452ca693af5278ff2ddc69b6f8ed0f346c98fb1;p=project%2Fluci2%2Fui.git luci2: initialize package pointers to NULL 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 --- 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 = {