# HG changeset patch # User Mike Becker # Date 1397302977 -7200 # Node ID 75ee459ba9414c51679bfbe40d857ee0ec6a6924 # Parent bcf624518909d9392bf440fd4177e2a67b6cb007 fixed memory underflow bug in mvwasyncgetnstr diff -r bcf624518909 -r 75ee459ba941 src/input.c --- a/src/input.c Thu Apr 10 12:10:09 2014 +0200 +++ b/src/input.c Sat Apr 12 13:42:57 2014 +0200 @@ -58,7 +58,9 @@ return 1; case KEY_BACKSPACE: case KEY_LEFT: - str[--(*pos)] = '\0'; + if ((*pos) > 0) { + str[--(*pos)] = '\0'; + } break; default: if (isprint(c) && *pos < len-1) {