Message ID | 20240705075709.26809-5-r.smirnov@omp.ru |
---|---|
State | New |
Headers | show |
Series | fix error found by SVACE static analyzer #2 | expand |
diff --git a/tools/rctest.c b/tools/rctest.c index e39d313eb..b72be917c 100644 --- a/tools/rctest.c +++ b/tools/rctest.c @@ -41,6 +41,8 @@ #define SIOCGSTAMP_OLD SIOCGSTAMP #endif +#define MAX_DATA_SIZE 0x40000000 + /* Test modes */ enum { SEND, @@ -749,7 +751,8 @@ int main(int argc, char *argv[]) break; case 'b': - data_size = atoi(optarg); + if (optarg && atoi(optarg) < MAX_DATA_SIZE) + data_size = atoi(optarg); break; case 'i':