From: Jens Axboe Date: Wed, 5 Oct 2005 11:05:00 +0000 (+0200) Subject: [PATCH] blktrace: sanity check the buf_size argument, cap at 16MiB. X-Git-Tag: blktrace-0.99~37 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=183a0855c6cc254df40ef443373afda9c6930561;p=blktrace.git [PATCH] blktrace: sanity check the buf_size argument, cap at 16MiB. --- diff --git a/blktrace.c b/blktrace.c index 8d94cbe..63b58ba 100644 --- a/blktrace.c +++ b/blktrace.c @@ -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;