1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: Colin Watson <cjwatson@ubuntu.com>
Date: Sat, 15 Feb 2014 22:47:02 +0000
Subject: Fix infinite loop parsing vim commands
This happens if a non-alphanumeric character other than whitespace or '-' is
found before the first alphanumeric character after 'command'.
Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=3214129&group_id=6556&atid=106556
Bug-Ubuntu: https://bugs.launchpad.net/bugs/736367
Forwarded: no
Last-Update: 2011-03-17
---
vim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vim.c b/vim.c
index 951ee5f..2be3777 100644
--- a/vim.c
+++ b/vim.c
@@ -394,7 +394,9 @@ static boolean parseCommand (const unsigned char *line)
while (*cp && !isspace ((int) *cp))
++cp;
}
- } while ( *cp && !isalnum ((int) *cp) );
+ else
+ break;
+ } while ( *cp );
if ( ! *cp )
{
|