1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-16 12:21:18 +02:00

24893: duplicate statusline to avoid crashes when constant

This commit is contained in:
Peter Stephenson 2008-04-29 08:43:38 +00:00
parent f8220437f2
commit f5ed24f47e
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-04-29 Peter Stephenson <pws@csr.com>
* 24893: Src/Zle/zle_refresh.c: duplicate statusline to avoid
crashes when it's passed from a constant string.
2008-04-28 Peter Stephenson <pws@csr.com>
* unposted: Src/Zle/zle_hist.c: when anchoring a pattern

View file

@ -1418,8 +1418,9 @@ zrefresh(void)
if (statusline) {
int outll, outsz;
char *statusdup = ztrdup(statusline);
ZLE_STRING_T outputline =
stringaszleline(statusline, 0, &outll, &outsz, NULL);
stringaszleline(statusdup, 0, &outll, &outsz, NULL);
rpms.tosln = rpms.ln + 1;
nbuf[rpms.ln][winw + 1] = zr_zr; /* text not wrapped */
@ -1484,6 +1485,7 @@ zrefresh(void)
snextline(&rpms);
}
zfree(outputline, outsz);
free(statusdup);
}
*rpms.s = zr_zr;