diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2007-04-02 11:00:35 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-04-02 11:00:35 +0000 |
| commit | a35302ebd4b02996481da9f13838125c201a6af3 (patch) | |
| tree | 2e98a932d4c9a7791896598891a01410c8d254e1 | |
| parent | 23255: fix 23253 better. (diff) | |
| download | zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar.gz zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar.bz2 zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar.lz zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar.xz zsh-a35302ebd4b02996481da9f13838125c201a6af3.tar.zst zsh-a35302ebd4b02996481da9f13838125c201a6af3.zip | |
23257: buffer too short for multibyte ${(#)...} evalution
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Src/subst.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2007-04-02 Peter Stephenson <pws@csr.com> + + * 23257: Src/subst.c: buffer too short for multibyte + ${(#)...} evaluation. + 2007-03-31 Clint Adams <clint@zsh.org> * 23255: Completion/Unix/Command/_module: fix 23253 better. diff --git a/Src/subst.c b/Src/subst.c index 9d6a41305..5d7a44b05 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1199,10 +1199,11 @@ substevalchar(char *ptr) return NULL; #ifdef MULTIBYTE_SUPPORT if (isset(MULTIBYTE) && ires > 127) { - char buf[10]; + /* '\\' + 'U' + 8 bytes of character + '\0' */ + char buf[11]; /* inefficient: should separate out \U handling from getkeystring */ - sprintf(buf, "\\U%.8x", (unsigned int)ires); + sprintf(buf, "\\U%.8x", (unsigned int)ires & 0xFFFFFFFFu); ptr = getkeystring(buf, &len, GETKEYS_BINDKEY, NULL); } if (len == 0) |
