We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0438bd commit a0414d6Copy full SHA for a0414d6
src/clean.c
@@ -2211,8 +2211,10 @@ Bool TY_(TidyMetaCharset)(TidyDocImpl* doc)
2211
tidyBufAppend(&charsetString, "charset=", 8);
2212
tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc));
2213
tidyBufAppend(&charsetString, "\0", 1); /* zero terminate the buffer */
2214
- /* process the children of the head */
2215
- for (currentNode = head->content; currentNode; currentNode = currentNode->next)
+ /* process the children of the head */
+ /* Issue #656 - guard against 'currentNode' being set NULL in loop */
2216
+ for (currentNode = head->content; currentNode;
2217
+ currentNode = (currentNode ? currentNode->next : NULL))
2218
{
2219
if (!nodeIsMETA(currentNode))
2220
continue; /* not a meta node */
0 commit comments