Skip to content

Commit 7b654e1

Browse files
committed
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>
1 parent 13c534d commit 7b654e1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/apk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,5 +689,7 @@ int main(int argc, char **argv)
689689
apk_string_array_free(&args);
690690
free(apk_argv);
691691

692+
if (r < 0) r = 250;
693+
if (r > 99) r = 99;
692694
return r;
693695
}

0 commit comments

Comments
 (0)