safe_malloc() and safe_realloc() are wrappers around malloc() and realloc()
than abort the process if the memory allocation fails.
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[Matthias Schiffer: add safe_realloc()]
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()]
Previously supplying an invalid url for download would result in
uclient_new returning NULL and crash the autoupdater as soon as
cl->priv is accessed.
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
This new version of the autoupdater is implemented in C instead of Lua,
allowing us to interface with libuclient (HTTP downloads) and libecdsautil
(signature checks) directly instead of spawning external processes,
saving RAM and making error handling more robust.
[Matthias Schiffer: add commit message]