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