From e4a8069b329cacd6486f831bb55273f8253295b2 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Sat, 24 Mar 2018 15:17:37 +0900 Subject: 42501: avoid out of bound pointer (as 42487) --- Src/Zle/complete.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Src/Zle/complete.c') diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 16f48c958..313dcb92f 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -715,11 +715,10 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) case 'E': if (p[1]) { dat.dummies = atoi(p + 1); - p = "" - 1; + p += strlen(p+1); } else if (argv[1]) { argv++; dat.dummies = atoi(*argv); - p = "" - 1; } else { zwarnnam(name, "number expected after -%c", *p); zsfree(mstr); @@ -744,13 +743,12 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) /* Pasted argument: -Xfoo. */ if (!*sp) *sp = p + 1; - p = "" - 1; + p += strlen(p+1); } else if (argv[1]) { /* Argument in a separate word: -X foo. */ argv++; if (!*sp) *sp = *argv; - p = "" - 1; } else { /* Missing argument: argv[N] == "-X", argv[N+1] == NULL. */ zwarnnam(name, e, *p); -- cgit 1.4.1