Fix PR#858, /bin/sh corruption caused by non-zeroed malloc() in libedit
in particular circumstances. (malloc() does not zero memory, but usually does by coincidenct that sbrk() returns zeroed pages) Submitted-by: John Hood <cgull@smoke.marlboro.vt.us>
This commit is contained in:
parent
9fd7da5843
commit
e210ca89ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12565
@ -234,6 +234,7 @@ term_init(el)
|
||||
el->el_term.t_buf = (char *) el_malloc(TC_BUFSIZE);
|
||||
el->el_term.t_cap = (char *) el_malloc(TC_BUFSIZE);
|
||||
el->el_term.t_fkey = (fkey_t *) el_malloc(4 * sizeof(fkey_t));
|
||||
(void) memset(el->el_term.t_fkey, 0, 4 * sizeof(fkey_t));
|
||||
el->el_term.t_loc = 0;
|
||||
el->el_term.t_str = (char **) el_malloc(T_str * sizeof(char*));
|
||||
(void) memset(el->el_term.t_str, 0, T_str * sizeof(char*));
|
||||
|
Loading…
Reference in New Issue
Block a user