From a0741cbb98a0399d26e90cb05604bbfb20a45bc6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 5 Mar 2010 12:46:37 +0100 Subject: [PATCH 1/1] Fix parse strlen() bug Commit 38789b58775ee5e00f4669f01b3c9da31a7345e3 checks the wrong string, it's unitialized garbage. Signed-off-by: Jens Axboe --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.25.1