diff options
author | Paulo Andrade <pandrade@redhat.com> | 2017-01-03 12:29:34 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2017-01-03 12:00:18 +0000 |
commit | 8d4c98540de9bcdba8565facc91fbc45855d27e2 (patch) | |
tree | d4b97226dbff8f21f1b3563fc89e372139ea6b66 | |
parent | 4fb4ce190ccb45991979deed503ff3bdfc56ccf2 (diff) | |
download | zsh-8d4c98540de9bcdba8565facc91fbc45855d27e2.tar.gz zsh-8d4c98540de9bcdba8565facc91fbc45855d27e2.tar.xz zsh-8d4c98540de9bcdba8565facc91fbc45855d27e2.zip |
40260: zero new space allocated in prompt buffer
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/prompt.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 3bb1c6c5d..f3c9c5654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-01-03 Peter Stephenson <p.stephenson@samsung.com> + + * Paulo Andrade: 40260: Src/prompt.c: Set newly allocated + space in prompt buffer to zero as it may be tested. + 2016-12-28 Sebastian Gniazdowski <psprint@fastmail.com> * 40231: Src/params.c: Optimise setarrvalue(). diff --git a/Src/prompt.c b/Src/prompt.c index ee77c8bc8..29e006e0e 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -920,6 +920,7 @@ addbufspc(int need) if(need & 255) need = (need | 255) + 1; bv->buf = realloc(bv->buf, bv->bufspc += need); + memset(bv->buf + bv->bufspc - need, 0, need); bv->bp = bv->buf + bo; if(bo1 != -1) bv->bp1 = bv->buf + bo1; |