1 Star 0 Fork 12

huanghaitao/tidy

forked from src-openEuler/tidy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-Issue-656-protect-against-NULL-node-set-in-loop.patch 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
通行百万 提交于 2020-02-19 18:29 . package init
From a0414d65a69927808240e41c1235145413978c43 Mon Sep 17 00:00:00 2001
From: Geoff McLane <ubuntu@geoffair.info>
Date: Sat, 16 Dec 2017 20:54:29 +0100
Subject: [PATCH 02/12] Issue #656 - protect against NULL node set in loop
---
src/clean.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/clean.c b/src/clean.c
index de4caf5..e96dd3f 100644
--- a/src/clean.c
+++ b/src/clean.c
@@ -2211,8 +2211,10 @@ Bool TY_(TidyMetaCharset)(TidyDocImpl* doc)
tidyBufAppend(&charsetString, "charset=", 8);
tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc));
tidyBufAppend(&charsetString, "\0", 1); /* zero terminate the buffer */
- /* process the children of the head */
- for (currentNode = head->content; currentNode; currentNode = currentNode->next)
+ /* process the children of the head */
+ /* Issue #656 - guard against 'currentNode' being set NULL in loop */
+ for (currentNode = head->content; currentNode;
+ currentNode = (currentNode ? currentNode->next : NULL))
{
if (!nodeIsMETA(currentNode))
continue; /* not a meta node */
--
2.14.3
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hht8/tidy.git
git@gitee.com:hht8/tidy.git
hht8
tidy
tidy
master

搜索帮助