commit ca6d7b6a465578b7a2f6a55184f329cc81f09a35
parent d6313c2f8cced2bb66e1ec1528ce286845ffdbbd
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 25 Apr 2017 13:01:21 +0200
input: avoid crashing when resizing the window during verbatim input
This fixes https://savannah.gnu.org/bugs/?50872.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1463,7 +1463,8 @@ int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
retval = parse_verbatim_kbinput(win, kbinput_len);
/* If the code is invalid in the current mode, discard it. */
- if ((*retval == '\n' && as_an_at) || (*retval == '\0' && !as_an_at)) {
+ if (retval != NULL && ((*retval == '\n' && as_an_at) ||
+ (*retval == '\0' && !as_an_at))) {
*kbinput_len = 0;
beep();
}