commit 3cb55c8b277875e4e33250b414d3deb5c2dc421e
parent 306906a8a75e4120ec7e7948cf6680bd9aa5e4d4
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 15 Aug 2020 11:15:44 +0200
verbatim: reserve enough space for the result also in non-UTF-8 locales
Also when each character is just one byte, parse_verbatim_kbinput()
can produce two bytes; plus the terminating NUL that is three bytes.
This fixes https://savannah.gnu.org/bugs/?58959.
Bug existed since version 4.9, commit 03d296eb.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1449,7 +1449,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
* an escape sequence, and return the resulting number of bytes in count. */
char *get_verbatim_kbinput(WINDOW *win, size_t *count)
{
- char *bytes = charalloc(MAXCHARLEN + 1);
+ char *bytes = charalloc(MAXCHARLEN + 2);
int *input;
/* Turn off flow control characters if necessary so that we can type