Skip to content
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 <>
  • Loading branch information
fabled committed Sep 5, 2018
1 parent 13c534d commit 7b654e125461b00bc26e52b25e6a7be3a32c11b9
Showing 1 changed file with 2 additions and 0 deletions.
@@ -689,5 +689,7 @@ int main(int argc, char **argv)

if (r < 0) r = 250;
if (r > 99) r = 99;

This comment has been minimized.

Copy link

rud Oct 22, 2018

A thought: if r < 0 is true, the end result will be that r = 99 as both if statements will match. If the two lines are reversed you'd have both 250 and 99 as possible return values. Or am I reading this wrong?

This comment has been minimized.

Copy link

fabled Oct 22, 2018

Author Contributor

Thanks. I think an else was intended for the second if.

return r;

0 comments on commit 7b654e1

Please sign in to comment.