summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-05-22 10:11:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-05-22 10:11:00 +0000
commit46557b1e1c5dbfbc22e09bffb405b7f89e6cbc48 (patch)
tree33e8aca7e963c3adae8d52abf111d7a5177f5779
parentf473fac9468fbfc0e241aca73a8fdafcf73987ab (diff)
downloadzsh-46557b1e1c5dbfbc22e09bffb405b7f89e6cbc48.tar.gz
zsh-46557b1e1c5dbfbc22e09bffb405b7f89e6cbc48.tar.xz
zsh-46557b1e1c5dbfbc22e09bffb405b7f89e6cbc48.zip
18569: pointer error with ${(on)...}
-rw-r--r--ChangeLog3
-rw-r--r--Src/subst.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 316f9bbdb..c996cb436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-05-22  Peter Stephenson  <pws@csr.com>
 
+	* 18569: Src/subst.c: error with numeric sorting of parameters;
+	owing to typo pointers could become corrupt.
+
 	* 18559, 18562: README, Doc/Zsh/mod_socket.yo, Doc/Zsh/mod_tcp.yo,
 	Doc/Zsh/zle.yo, Src/zsh.h, Src/Modules/files.c,
 	Src/Modules/socket.c, Src/Modules/tcp.c Src/Zle/zle_keymap.c
diff --git a/Src/subst.c b/Src/subst.c
index 89ecbab7a..a84bfbd74 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -554,7 +554,7 @@ nstrpcmp(const void *a, const void *b)
     cmp = (int)STOUC(*c) - (int)STOUC(*d);
 #endif
     if (idigit(*c) || idigit(*d)) {
-	for (; c > *(char **)b && idigit(c[-1]); c--, d--);
+	for (; c > *(char **)a && idigit(c[-1]); c--, d--);
 	if (idigit(*c) && idigit(*d)) {
 	    while (*c == '0')
 		c++;