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

PATCH: Re: zsh-3.1.9 coredumps while completing...



I wrote:

> Thomas Koehler wrote:
> 
> > ...
> > 
> > (gdb) bt
> > #0  0x4020c3b7 in comp_setunset () from /usr/lib/zsh/3.1.9/zsh/complete.so
> > #1  0x806025a in runshfunc ()
> 
> Of course runshfunc() doesn't call comp_setunset(), so I guess this
> may be one of those VARARR() problems which messes up the stack. I'll
> have a look.

I still couldn't reproduce that (of course, that would be too simple)
and the only VARARR() that might be a bit insecure is the one below.

Dunno if this was really the cause, though. To at least if it might
have been the cause, I would need some more information, such as the
match specs used, modules used (complist?) etc.

Bye
 Sven

Index: Src/Zle/compmatch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v
retrieving revision 1.22
diff -u -r1.22 compmatch.c
--- Src/Zle/compmatch.c	2000/06/19 10:48:21	1.22
+++ Src/Zle/compmatch.c	2000/07/19 14:01:16
@@ -442,7 +442,7 @@
 {
     int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw;
     int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc, bslash;
-    VARARR(unsigned char, ea, ll + 1);
+    VARARR(unsigned char, ea, (ll > lw ? ll : lw) + 1);
     char *ow;
     Cmlist ms;
     Cmatcher mp, lm = NULL;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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