mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
36580: don't copy empty buffer in compmatch.
Also check if length is non-zero when buffer is empty.
This commit is contained in:
parent
8b84419f45
commit
729f6ddfff
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2015-09-21 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 36580: Src/Zle/compmatch.c: don't copy empty buffer and check
|
||||||
|
size is consistent.
|
||||||
|
|
||||||
2015-09-21 Frank Terbeck <ft@bewatermyfriend.org>
|
2015-09-21 Frank Terbeck <ft@bewatermyfriend.org>
|
||||||
|
|
||||||
* 36575: Completion/Unix/Command/_tmux: _tmux: ‘lock-server’
|
* 36575: Completion/Unix/Command/_tmux: _tmux: ‘lock-server’
|
||||||
|
|
|
@ -338,8 +338,15 @@ add_match_str(Cmatcher m, char *l, char *w, int wl, int sfx)
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = (char *) zalloc(blen);
|
buf = (char *) zalloc(blen);
|
||||||
|
if (matchbuf) {
|
||||||
memcpy(buf, matchbuf, matchbuflen);
|
memcpy(buf, matchbuf, matchbuflen);
|
||||||
zfree(matchbuf, matchbuflen);
|
zfree(matchbuf, matchbuflen);
|
||||||
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
else {
|
||||||
|
DPUTS(matchbuflen, "matchbuflen with no matchbuf");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
matchbuf = buf;
|
matchbuf = buf;
|
||||||
matchbuflen = blen;
|
matchbuflen = blen;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue