From 5d43f66117b79cb321dcadbc122e9af933063068 Mon Sep 17 00:00:00 2001 From: "peterv%propagandism.org" Date: Thu, 16 Jun 2005 11:59:28 +0000 Subject: [PATCH] Fix for bug 289169 (DOMParser freezes when parsing elements with fixed attributes.). r/sr=jst, a=asa. --- parser/expat/lib/xmlparse.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c index 25bdc390193..599861c4ecf 100644 --- a/parser/expat/lib/xmlparse.c +++ b/parser/expat/lib/xmlparse.c @@ -2843,11 +2843,14 @@ storeAtts(XML_Parser parser, const ENCODING *enc, /* BEGIN MOZILLA CHANGE (Include xmlns attributes in attributes array) */ #if 0 if (!--nPrefixes) + break; #else - if (!--nPrefixes && !nXMLNSDeclarations) + if (!--nPrefixes && !nXMLNSDeclarations) { + i += 2; + break; + } #endif /* END MOZILLA CHANGE */ - break; } /* BEGIN MOZILLA CHANGE (Include xmlns attributes in attributes array) */ else if (s[-1] == 3) { /* xmlns attribute */ @@ -2891,8 +2894,10 @@ storeAtts(XML_Parser parser, const ENCODING *enc, poolFinish(&tempPool); appAtts[i] = s; - if (!--nXMLNSDeclarations && !nPrefixes) + if (!--nXMLNSDeclarations && !nPrefixes) { + i += 2; break; + } } /* END MOZILLA CHANGE */ else /* not prefixed */