about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-04-02 22:19:27 +0100
committerJames Booth <boothj5@gmail.com>2014-04-02 22:19:27 +0100
commite083e203136a71948a258c2c46cc5d5849ef944d (patch)
tree96c3e500a8c4ba8aa45129f0a5f8ea43b7de7a51
parenta720ef262774e51066f5885c76deebde83dec74e (diff)
downloadprofani-tty-e083e203136a71948a258c2c46cc5d5849ef944d.tar.gz
Added check on input length
-rw-r--r--src/ui/inputwin.c4
1 files changed, 4 insertions, 0 deletions
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