Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: more on crashes



> In all cases I'm doing --enable-zsh-mem .
> 
> Compiled on AIX 4.2 it crashes right when I hit the backspace for the 10th
> time.

Bill mailed me that bindkey -v was necessary for the crash.  I tried it and
after the 10th backpace zsh printed that someone tried to free more than
allocated.

Patch below.

Zoltan


--- Src/zle_utils.c	1996/07/28 19:50:55	2.11
+++ Src/zle_utils.c	1996/08/02 22:08:55
@@ -93,7 +93,7 @@
 	if ((vibuf[vibufspec].flags & CUTBUFFER_LINE) && !vilinerange)
 	    vibufappend = 0;
 	if (!vibufappend || !vibuf[vibufspec].buf) {
-	    zsfree(vibuf[vibufspec].buf);
+	    zfree(vibuf[vibufspec].buf, vibuf[vibufspec].len);
 	    vibuf[vibufspec].buf = (char *)zalloc(ct);
 	    memcpy(vibuf[vibufspec].buf, (char *) line + i, ct);
 	    vibuf[vibufspec].len = ct;
@@ -115,7 +115,7 @@
     } else {
 	/* Save in "1, shifting "1-"8 along to "2-"9 */
 	int n;
-	zsfree(vibuf[34].buf);
+	zfree(vibuf[34].buf, vibuf[34].len);
 	for(n=34; n>26; n--)
 	    vibuf[n] = vibuf[n-1];
 	vibuf[26].buf = (char *)zalloc(ct);



Messages sorted by: Reverse Date, Date, Thread, Author