]> git.pld-linux.org Git - packages/ctags.git/blame - ctags-5.7-segment-fault.patch
- rel 5; add fixes and improvements from FC
[packages/ctags.git] / ctags-5.7-segment-fault.patch
CommitLineData
f5823ca3
AM
1diff -ruN -x '*~' ctags-5.7/vim.c ctags-5.7/vim.c
2--- ctags-5.7/vim.c 2006-10-26 12:06:21.000000000 +0900
3+++ ctags-5.7/vim.c 2009-08-28 22:21:31.000000000 +0900
4@@ -328,7 +328,7 @@
5 */
6 const unsigned char *cp = line;
7
8- if ( (int) *cp == '\\' )
9+ if ( cp && ( (int) *cp == '\\' ) )
10 {
11 /*
12 * We are recursively calling this function is the command
13@@ -350,9 +350,10 @@
14 while (*cp && isspace ((int) *cp))
15 ++cp;
16 }
17- else if ( (!strncmp ((const char*) line, "comp", (size_t) 4) == 0) &&
18- (!strncmp ((const char*) line, "comc", (size_t) 4) == 0) &&
19- (strncmp ((const char*) line, "com", (size_t) 3) == 0) )
20+ else if ( line &&
21+ (!strncmp ((const char*) line, "comp", (size_t) 4) == 0) &&
22+ (!strncmp ((const char*) line, "comc", (size_t) 4) == 0) &&
23+ (strncmp ((const char*) line, "com", (size_t) 3) == 0) )
24 {
25 cp += 2;
26 if ((int) *++cp == 'm' && (int) *++cp == 'a' &&
27@@ -394,6 +395,14 @@
28 while (*cp && !isspace ((int) *cp))
29 ++cp;
30 }
31+ else if (!isalnum ((int) *cp))
32+ {
33+ /*
34+ * Broken syntax: throw away this line
35+ */
36+ cmdProcessed = TRUE;
37+ goto cleanUp;
38+ }
39 } while ( *cp && !isalnum ((int) *cp) );
40
41 if ( ! *cp )
This page took 0.099501 seconds and 4 git commands to generate.