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> [Matthias Schiffer: use abort()]
This commit is contained in:
parent
c802276581
commit
0b61fee98e
|
@ -109,6 +109,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");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
ctx->flags &= ~UCI_FLAG_STRICT;
|
ctx->flags &= ~UCI_FLAG_STRICT;
|
||||||
|
|
||||||
struct uci_package *p;
|
struct uci_package *p;
|
||||||
|
|
Loading…
Reference in New Issue