summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2023-10-08 23:47:25 +0200
committerOliver Kiddle <opk@zsh.org>2023-10-11 00:43:05 +0200
commit83f8a71a7cc2137a1d4638228b3d83717c15af54 (patch)
treebe450a54ca09c900577afcd18a9eb64cbef2d8df /Src
parenta920e368b87f24e95b015eb091e1112c378c2939 (diff)
downloadzsh-83f8a71a7cc2137a1d4638228b3d83717c15af54.tar.gz
zsh-83f8a71a7cc2137a1d4638228b3d83717c15af54.zip
52214: allow extra byte for nul terminator in allocation
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c
index cdbfc138a..60d850feb 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -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)