Closed Bug 67004 Opened 24 years ago Closed 24 years ago

Infinite loop caused by malformed XPath expression

Categories

(Core :: XSLT, defect)

PowerPC
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: darkmane, Assigned: keith)

References

Details

Attachments

(3 files)

I'll attach a test case, but in ExprParser::createUnionExpr(ExprLexer& lexer) the expression '<apply-templates match="testvalue@testattrib=Test"/>' causes an infinite loop. The code seems to be stuck on the '='.
Attached file Test Case XML file
Attached file Test Case XSL file
Your Xpath expression is invalid. I'll look into the infinite loop because we shouldn't be entering an infinite loop even on badly formed XPath expressions. You are missing a "/" between testvalue and @. --Keith
Reporter did the above suggestion fix the problem?
Yes that did fix my problem, but the underlying bug (Infinite Loop on Malformed XPath rather than complex) is still there.
Marking NEW as per comments.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Changing subject line to something more meaningful.
Summary: Infinite loop in transformiix caused by complex XPath matching → Infinite loop caused by malformed XPath expression
*** Bug 67349 has been marked as a duplicate of this bug. ***
67349 is not really a duplicate. It's similiar because we don't throw an XPath error, but there is no infinate loop caused by "test@attr". The infinite loop occurs for something like this "test@attr=foo". In both cases we need to report an error within the expression however. --Keith
Status: NEW → ASSIGNED
OK...I know where to fix it, the only problem is how to report the error! :-( How should we handle errors within Mozilla? --Keith
Attaching a patch which at least prints out an error and prevents the infinite loop. We still need to come up with a proper way to report errors.
Error reporting should be done by generating a result document describing the error. This seems to say, report the error from XPath to XSLT somehow, right? Perhaps we should add a error code and string to XPath, this should go into the XPathProcessor, too. Peter? Axel
Adding patch, review keyword
Keywords: patch, review
Keith has checkin perms, no patch keyword. This is for unprivileged contributors only. Axel
Keywords: patch
r=me, looks good. no new bugs, will file the old ones ;-)
Keywords: review
Fixed with the lexer/parser rewrite
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
bitching buttons, verfication spam
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: