From 1d1c187b36fd4ee28d72d04660b37a7c3edd64e6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 29 Jul 2010 10:50:05 +0200 Subject: [PATCH] Fix bad deref of memory in parser Signed-off-by: Jens Axboe --- parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parse.c b/parse.c index d8061610..db2f5a42 100644 --- a/parse.c +++ b/parse.c @@ -169,6 +169,9 @@ static unsigned long long get_mult_bytes(const char *str, int len, void *data) { const char *p; + if (len < 2) + return __get_mult_bytes(str, data); + /* * if the last char is 'b' or 'B', the user likely used * "1gb" instead of just "1g". If the second to last is also -- 2.25.1