Skip to content

Commit

Permalink
btrfs-progs: crypto: handle invalid number of iterations
Browse files Browse the repository at this point in the history
The parameter for iterations accepts 0, which crashes later.

Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jan 8, 2025
1 parent 1b63232 commit 3924a1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/hash-speedtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ int main(int argc, char **argv) {

if (argc - optind >= 1) {
iterations = atoi(argv[optind]);
if (iterations < 0)
if (iterations < 1)
iterations = 1;
}

Expand Down

0 comments on commit 3924a1b

Please sign in to comment.