From 572538c6d7f1e64ce78ef70abe974e3466c53e38 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 17 Dec 2019 15:25:58 -0500 Subject: [PATCH] Update clean.c Protect against NULL in PruneSetion. A Null node happens when pruning unbalanced . --- src/clean.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/clean.c b/src/clean.c index e96dd3f..dc6cac1 100644 --- a/src/clean.c +++ b/src/clean.c @@ -1638,6 +1638,9 @@ static Node* PruneSection( TidyDocImpl* doc, Node *node ) for (;;) { + if (node == NULL) + return NULL; + ctmbstr lexbuf = lexer->lexbuf + node->start; if ( TY_(tmbstrncmp)(lexbuf, "if !supportEmptyParas", 21) == 0 ) {