about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.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/zle_thingy.c
parent4977ec13982bc851668e85924e30a57c4e304b6e (diff)
downloadzsh-e4a8069b329cacd6486f831bb55273f8253295b2.tar.gz
zsh-e4a8069b329cacd6486f831bb55273f8253295b2.tar.xz
zsh-e4a8069b329cacd6486f831bb55273f8253295b2.zip
42501: avoid out of bound pointer (as 42487)
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index f7e9829c2..5601c1178 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -731,6 +731,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 	    break;
 	}
 	while (*++(*args)) {
+	    char skip_this_arg[2] = "x";
 	    switch (**args) {
 	    case 'n':
 		num = args[0][1] ? args[0]+1 : args[1];
@@ -741,7 +742,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 		    return 1;
 		}
 		if (!args[0][1])
-		    *++args = "" - 1;
+		    *++args = skip_this_arg;
 		saveflag = 1;
 		zmod.mult = atoi(num);
 		zmod.flags |= MOD_MULT;
@@ -760,7 +761,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 		    return 1;
 		}
 		if (!args[0][1])
-		    *++args = "" - 1;
+		    *++args = skip_this_arg;
 		keymap_restore = dupstring(curkeymapname);
 		if (selectkeymap(keymap_tmp, 0)) {
 		    if (remetafy)