From e083e203136a71948a258c2c46cc5d5849ef944d Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 2 Apr 2014 22:19:27 +0100 Subject: [PATCH] Added check on input length --- src/ui/inputwin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 5b5fb381..365eed02 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -142,6 +142,10 @@ _inp_get_char(char *input, int *size) // if it wasn't an arrow key etc if (!_handle_edit(result, ch, input, size)) { if (_printable(ch) && result != KEY_CODE_YES) { + if (*size >= INP_WIN_MAX) { + return ERR; + } + inp_x = getcurx(inp_win); // handle insert if not at end of input