File: cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch

package info (click to toggle)
zsh 5.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,324 kB
  • ctags: 8,554
  • sloc: ansic: 104,868; sh: 6,584; perl: 813; makefile: 774; awk: 388; sed: 16
file content (15 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Description: zero new space allocated in prompt buffer
Origin: 8d4c98540de9bcdba8565facc91fbc45855d27e2
Author: Paulo Andrade <pandrade@redhat.com>
Reviewed-By: Daniel Shahaf <d.s@daniel.shahaf.name>

--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -920,6 +920,7 @@
 	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;