1 Star 0 Fork 8

sqfu/ctags

forked from src-openEuler/ctags 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-ctags-5.7-segment-fault.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:36 . Package init
diff -ruN -x '*~' ctags-5.7/vim.c ctags-5.7/vim.c
--- ctags-5.7/vim.c 2006-10-26 12:06:21.000000000 +0900
+++ ctags-5.7/vim.c 2009-08-28 22:21:31.000000000 +0900
@@ -328,7 +328,7 @@
*/
const unsigned char *cp = line;
- if ( (int) *cp == '\\' )
+ if ( cp && ( (int) *cp == '\\' ) )
{
/*
* We are recursively calling this function is the command
@@ -350,9 +350,10 @@
while (*cp && isspace ((int) *cp))
++cp;
}
- else if ( (!strncmp ((const char*) line, "comp", (size_t) 4) == 0) &&
- (!strncmp ((const char*) line, "comc", (size_t) 4) == 0) &&
- (strncmp ((const char*) line, "com", (size_t) 3) == 0) )
+ else if ( line &&
+ (!strncmp ((const char*) line, "comp", (size_t) 4) == 0) &&
+ (!strncmp ((const char*) line, "comc", (size_t) 4) == 0) &&
+ (strncmp ((const char*) line, "com", (size_t) 3) == 0) )
{
cp += 2;
if ((int) *++cp == 'm' && (int) *++cp == 'a' &&
@@ -394,6 +395,14 @@
while (*cp && !isspace ((int) *cp))
++cp;
}
+ else if (!isalnum ((int) *cp))
+ {
+ /*
+ * Broken syntax: throw away this line
+ */
+ cmdProcessed = TRUE;
+ goto cleanUp;
+ }
} while ( *cp && !isalnum ((int) *cp) );
if ( ! *cp )
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fu-shanqing/ctags.git
[email protected]:fu-shanqing/ctags.git
fu-shanqing
ctags
ctags
master

搜索帮助