Add range check

This commit is contained in:
Arun Prakash Jana 2021-06-20 19:20:10 +05:30
parent 0e8819fea8
commit c597f3be9b
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 6 additions and 2 deletions

View File

@ -7857,8 +7857,12 @@ int main(int argc, char *argv[])
break;
#ifndef NOFIFO
case 'F':
if (env_opts_id < 0)
g_state.fifobits = atoi(optarg);
if (env_opts_id < 0) {
fd = atoi(optarg);
if ((fd < 0) || (fd > 2))
return EXIT_FAILURE;
g_state.fifobits = fd;
}
break;
#endif
case 'g':