From 8090e5856465c0b8e26e2a080f4b498f37fa83ab Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 17 Mar 2023 12:27:07 +0100
Subject: [PATCH] malloc-fail: Fix buffer overread in htmlParseScript

Found by OSS-Fuzz, see #344.

Reference:https://github.com/GNOME/libxml2/commit/8090e5856465c0b8e26e2a080f4b498f37fa83ab
Conflict:NA

---
 HTMLparser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/HTMLparser.c b/HTMLparser.c
index 6c8f180..3682807 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -3145,8 +3145,8 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
 	    }
 	    nbchar = 0;
 	}
-	GROW;
 	NEXTL(l);
+	GROW;
 	cur = CUR_CHAR(l);
     }
 
-- 
2.27.0

