]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
keys: Fix intermittent buffer overflow when pasting text. From malice
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 24 Jan 2021 02:23:33 +0000 (02:23 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 24 Jan 2021 02:23:33 +0000 (02:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13092 d7cf8633-e32d-0410-b094-e92efae38249

keys.c

diff --git a/keys.c b/keys.c
index 3038eba6498bfa4c963b1018baa96bc28038939c..d830e827abbecab806f3bab29991aef6c47f5f59 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -782,7 +782,8 @@ int Key_Parse_CommonKeys(cmd_state_t *cmd, qbool is_console, int key, int unicod
                                }
                                else if (*p == '\n' || *p == '\r' || *p == '\b')
                                        *p++ = ';';
-                               p++;
+                               else
+                                       p++;
                        }
 #else
                        strtok(cbd, "\n\r\b");