[PATCH] blktrace: sanity check the buf_size argument, cap at 16MiB.
authorJens Axboe <axboe@suse.de>
Wed, 5 Oct 2005 11:05:00 +0000 (13:05 +0200)
committerJens Axboe <axboe@suse.de>
Wed, 5 Oct 2005 11:05:00 +0000 (13:05 +0200)
blktrace.c

index 8d94cbe5a1381d88b27468222510b89cee675a06..63b58ba8e0e430c23dc103cdc956462c5432746f 100644 (file)
@@ -710,7 +710,7 @@ int main(int argc, char *argv[])
                        return 0;
                case 'b':
                        buf_size = atoi(optarg);
-                       if (buf_size <= 0) {
+                       if (buf_size <= 0 || buf_size > 16*1024) {
                                fprintf(stderr,
                                        "Invalid buffer size (%d)\n", buf_size);
                                return 1;