diff options
author | Timo Teräs <timo.teras@iki.fi> | 2018-09-05 10:21:22 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-09-05 10:21:22 +0300 |
commit | 7b654e125461b00bc26e52b25e6a7be3a32c11b9 (patch) | |
tree | 57ad28f6719a8e46d5ca4bc974ccdb079c62603d /src | |
parent | 13c534db7755865380bfd930aa384aebc16347e6 (diff) | |
download | apk-tools-7b654e125461b00bc26e52b25e6a7be3a32c11b9.tar.gz apk-tools-7b654e125461b00bc26e52b25e6a7be3a32c11b9.tar.bz2 apk-tools-7b654e125461b00bc26e52b25e6a7be3a32c11b9.tar.xz apk-tools-7b654e125461b00bc26e52b25e6a7be3a32c11b9.zip |
apk: sanitize return value
Most applets return whatever apk_solver_commit() returns. It is the
number of errors found (or negative for hard error). Sanitize the
error value to not give false success exit code in the unlikely case
of errors % 256 == 0.
Reported-by: Max Justicz <max@justi.cz>
Diffstat (limited to 'src')
-rw-r--r-- | src/apk.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -689,5 +689,7 @@ err: apk_string_array_free(&args); free(apk_argv); + if (r < 0) r = 250; + if (r > 99) r = 99; return r; } |