From d743c5c6f39d6c9700174e156cc4284c36f2dea9 Mon Sep 17 00:00:00 2001 From: Erik van der Kouwe Date: Mon, 23 Aug 2010 16:30:58 +0000 Subject: [PATCH] Solve buffer overflow on tab completion in ash --- lib/libedit/complete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libedit/complete.c b/lib/libedit/complete.c index d454dc4d0..cfdff493f 100644 --- a/lib/libedit/complete.c +++ b/lib/libedit/complete.c @@ -188,7 +188,7 @@ rl_complete(pathname, unique) if (ac == 1) { /* Exactly one match -- finish it off. */ *unique = 1; - j = strlen(av[0]) - len + 2; + j = strlen(av[0]) - len + 1; if ((p = NEW(char, j + 1)) != NULL) { COPYFROMTO(p, av[0] + len, j); if ((new = NEW(char, strlen(dir) + strlen(av[0]) + 2)) != NULL) { -- 2.44.0