autoupdater: Check if allocation of uci contect was successfull
Previously the return value of uci_alloc_context was not checked leading to a possible null ptr dereference Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
This commit is contained in:
parent
a96a2d7718
commit
a6336d0bce
|
@ -110,6 +110,11 @@ static const char ** load_string_list(struct uci_context *ctx, struct uci_sectio
|
||||||
|
|
||||||
void load_settings(struct settings *settings) {
|
void load_settings(struct settings *settings) {
|
||||||
struct uci_context *ctx = uci_alloc_context();
|
struct uci_context *ctx = uci_alloc_context();
|
||||||
|
if (!ctx) {
|
||||||
|
fprintf(stderr, "autoupdater: error: failed to allocate uci context\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
ctx->flags &= ~UCI_FLAG_STRICT;
|
ctx->flags &= ~UCI_FLAG_STRICT;
|
||||||
|
|
||||||
struct uci_package *p;
|
struct uci_package *p;
|
||||||
|
|
Loading…
Reference in New Issue