1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-19 06:26:04 +02:00

52214: allow extra byte for nul terminator in allocation

This commit is contained in:
Oliver Kiddle 2023-10-08 23:47:25 +02:00
parent a920e368b8
commit 83f8a71a7c
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2023-10-10 Oliver Kiddle <opk@zsh.org>
* 52214: Src/subst.c: allow extra byte for nul in allocation
* unposted (cf. 52166): Functions/Misc/run-help-svk:
remove obsolete helper for svk

View File

@ -1506,7 +1506,7 @@ substevalchar(char *ptr)
}
#ifdef MULTIBYTE_SUPPORT
else if (isset(MULTIBYTE) && ires > 127) {
ptr = zhalloc(MB_CUR_MAX);
ptr = zhalloc(MB_CUR_MAX+1);
len = ucs4tomb((unsigned int)ires & 0xffffffff, ptr);
}
if (len <= 0)