summaryrefslogtreecommitdiff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-03-24 15:17:37 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-03-24 15:22:10 +0900
commite4a8069b329cacd6486f831bb55273f8253295b2 (patch)
treed51fcb821d4111c527a31ede8bcb34371d7cc487 /Src/Zle/complete.c
parent4977ec13982bc851668e85924e30a57c4e304b6e (diff)
downloadzsh-e4a8069b329cacd6486f831bb55273f8253295b2.tar.gz
zsh-e4a8069b329cacd6486f831bb55273f8253295b2.zip
42501: avoid out of bound pointer (as 42487)
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c6
1 files changed, 2 insertions, 4 deletions
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);