1
0
mirror of https://github.com/freifunk-gluon/packages.git synced 2024-06-17 12:44:00 +02:00

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:
Tobias Schramm 2018-02-20 12:15:42 +01:00 committed by Matthias Schiffer
parent c802276581
commit 0b61fee98e
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -109,6 +109,11 @@ static const char ** load_string_list(struct uci_context *ctx, struct uci_sectio
void load_settings(struct settings *settings) {
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;
struct uci_package *p;