Permalink
Browse files

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>
  • Loading branch information...
fabled committed Sep 5, 2018
1 parent 13c534d commit 7b654e125461b00bc26e52b25e6a7be3a32c11b9
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/apk.c
View
@@ -689,5 +689,7 @@ int main(int argc, char **argv)
apk_string_array_free(&args);
free(apk_argv);
if (r < 0) r = 250;
if (r > 99) r = 99;
return r;
}

0 comments on commit 7b654e1

Please sign in to comment.