input: avoid crashing when resizing the window during verbatim input

This fixes https://savannah.gnu.org/bugs/?50872.
master
Benno Schulenberg 2017-04-25 13:01:21 +02:00
parent d6313c2f8c
commit ca6d7b6a46
1 changed files with 2 additions and 1 deletions

View File

@ -1463,7 +1463,8 @@ int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
retval = parse_verbatim_kbinput(win, kbinput_len); retval = parse_verbatim_kbinput(win, kbinput_len);
/* If the code is invalid in the current mode, discard it. */ /* 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; *kbinput_len = 0;
beep(); beep();
} }