1 Star 0 Fork 10

成子晗/maildrop

forked from src-openEuler/maildrop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Fix-SIGSEGV-in-reformime-1613761.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
成子晗 提交于 2020-10-22 14:14 . package init
From 1186c36c44ca581fd4819f59d1823d3f2ec17164 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@brianlane.com>
Date: Wed, 8 Aug 2018 13:06:58 -0700
Subject: [PATCH] Fix SIGSEGV in reformime (#1613761)
Check for NULL section when running strtok on it for decode and
do_extract handling.
---
libs/rfc2045/reformime.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libs/rfc2045/reformime.c b/libs/rfc2045/reformime.c
index 9851c65..49a0ebd 100644
--- a/libs/rfc2045/reformime.c
+++ b/libs/rfc2045/reformime.c
@@ -1164,10 +1164,11 @@ int rc=0;
}
else if (dodecode)
{
- mimesection = strtok(section,",");
+ mimesection = section ? strtok(section, ","):NULL;
do {
print_decode(p, mimesection);
- mimesection = strtok(NULL,",");
+ if (mimesection)
+ mimesection = strtok(NULL,",");
} while (mimesection != NULL);
}
else if (dorewrite)
@@ -1176,11 +1177,12 @@ int rc=0;
dsn(p, dodsn == 2);
else if (do_extract)
{
- mimesection = strtok(section,",");
+ mimesection = section ? strtok(section, ","):NULL;
do {
extract_section(p, mimesection, extract_filename,
argc-argn, argv+argn, do_extract);
- mimesection = strtok(NULL,",");
+ if (mimesection)
+ mimesection = strtok(NULL,",");
} while (mimesection != NULL);
}
else if (dovalidate)
--
2.17.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengzihan2/maildrop.git
git@gitee.com:chengzihan2/maildrop.git
chengzihan2
maildrop
maildrop
master

搜索帮助