1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

In zleread(), initialize the first byte of the "line" buffer to '\0'

so that functions such as magicspace() won't be accessing uninitialized
memory when they look at "line".
This commit is contained in:
Wayne Davison 2004-10-17 20:12:46 +00:00
parent d73354ba3c
commit 66baaced5d

View file

@ -815,6 +815,7 @@ zleread(char **lp, char **rp, int flags, int context)
histline = curhist;
undoing = 1;
line = (unsigned char *)zalloc((linesz = 256) + 2);
*line = '\0';
virangeflag = lastcmd = done = cs = ll = mark = 0;
vichgflag = 0;
viinsbegin = 0;