summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2004-10-17 20:12:46 +0000
committerWayne Davison <wayned@users.sourceforge.net>2004-10-17 20:12:46 +0000
commit66baaced5d84dce7f1902d80c954a078c1d2456f (patch)
tree5406ed307d233dc563ff966b73ad8087ea3810b0
parentd73354ba3ca3ad3fe7ebdaa7f10bc784ce29d07a (diff)
downloadzsh-66baaced5d84dce7f1902d80c954a078c1d2456f.tar.gz
zsh-66baaced5d84dce7f1902d80c954a078c1d2456f.tar.xz
zsh-66baaced5d84dce7f1902d80c954a078c1d2456f.zip
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".
-rw-r--r--Src/Zle/zle_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 48511e017..549ee21af 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -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;