mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/108274: tty-test.c: Insecure data handling (#8666)
This commit is contained in:
parent
40911e435e
commit
22d95e462e
@ -150,7 +150,12 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
int count = atoi(argv[1]);
|
||||
errno = 0;
|
||||
int count = (int)strtol(argv[1], NULL, 10);
|
||||
if (errno != 0) {
|
||||
abort();
|
||||
}
|
||||
count = (count < 0 || count > 99999) ? 0 : count;
|
||||
for (int i = 0; i < count; i++) {
|
||||
printf("line%d\n", i);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user