153aa9179Sopenharmony_ciFrom 1813411ca9f9b60e62ef70e8be2e169af0831edb Mon Sep 17 00:00:00 2001 253aa9179Sopenharmony_ciFrom: Nick Wellnhofer <wellnhofer@aevum.de> 353aa9179Sopenharmony_ciDate: Wed, 2 Nov 2022 10:53:24 +0100 453aa9179Sopenharmony_ciSubject: [PATCH 03/28] schemas: Fix infinite loop in 553aa9179Sopenharmony_ci xmlSchemaCheckElemSubstGroup 653aa9179Sopenharmony_ci 753aa9179Sopenharmony_ciTypes like xmlSchemaTypeAnyTypeDef have a base type pointing to itself, 853aa9179Sopenharmony_ciresulting in an infinite loop. 953aa9179Sopenharmony_ci 1053aa9179Sopenharmony_ciFixes #430. 1153aa9179Sopenharmony_ci 1253aa9179Sopenharmony_ciReference: https://github.com/GNOME/libxml2/commit/abb5a93fed95cfd628db72e9e1a51fc3ced5c941 1353aa9179Sopenharmony_ciConflict: NA 1453aa9179Sopenharmony_ci--- 1553aa9179Sopenharmony_ci xmlschemas.c | 3 ++- 1653aa9179Sopenharmony_ci 1 file changed, 2 insertions(+), 1 deletion(-) 1753aa9179Sopenharmony_ci 1853aa9179Sopenharmony_cidiff --git a/xmlschemas.c b/xmlschemas.c 1953aa9179Sopenharmony_ciindex 9aa6acf..4a767ac 100644 2053aa9179Sopenharmony_ci--- a/xmlschemas.c 2153aa9179Sopenharmony_ci+++ b/xmlschemas.c 2253aa9179Sopenharmony_ci@@ -19957,7 +19957,8 @@ xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt, 2353aa9179Sopenharmony_ci /* 2453aa9179Sopenharmony_ci * The set of all {derivation method}s involved in the derivation 2553aa9179Sopenharmony_ci */ 2653aa9179Sopenharmony_ci- while ((type != NULL) && (type != headType)) { 2753aa9179Sopenharmony_ci+ while ((type != NULL) && (type != headType) && 2853aa9179Sopenharmony_ci+ (type != type->baseType)) { 2953aa9179Sopenharmony_ci if ((WXS_IS_EXTENSION(type)) && 3053aa9179Sopenharmony_ci ((methSet & XML_SCHEMAS_TYPE_BLOCK_RESTRICTION) == 0)) 3153aa9179Sopenharmony_ci methSet |= XML_SCHEMAS_TYPE_BLOCK_EXTENSION; 3253aa9179Sopenharmony_ci-- 3353aa9179Sopenharmony_ci2.27.0 3453aa9179Sopenharmony_ci 35