From: Jens Axboe Date: Fri, 5 Mar 2010 11:46:37 +0000 (+0100) Subject: Fix parse strlen() bug X-Git-Tag: fio-1.38~30 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a0741cbb98a0399d26e90cb05604bbfb20a45bc6 Fix parse strlen() bug Commit 38789b58775ee5e00f4669f01b3c9da31a7345e3 checks the wrong string, it's unitialized garbage. Signed-off-by: Jens Axboe --- diff --git a/parse.c b/parse.c index d8527b50..9e3c5b17 100644 --- a/parse.c +++ b/parse.c @@ -658,7 +658,7 @@ static char *option_dup_subs(const char *opt) ssize_t nchr = OPT_LEN_MAX; size_t envlen; - if (strlen(in) + 1 > OPT_LEN_MAX) { + if (strlen(opt) + 1 > OPT_LEN_MAX) { fprintf(stderr, "OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX); return NULL; }