1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +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

@ -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;