Message ID | 20240704180752.94264-5-r.smirnov@omp.ru (mailing list archive) |
---|---|
State | Accepted |
Commit | 8e495f00cded86496ad5c32e7a3cf902a8bdbe82 |
Headers | show |
Series | fix errors found by SVACE static analyzer #2 | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | success | Gitlint PASS |
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':