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>
cute-signatures
Timo Teräs 2018-09-05 10:21:22 +03:00
parent 13c534db77
commit 7b654e1254
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}