Unlike ACF lucee XML document XmlRoot has its own XmRoot

Description

Using Lucee Version: 5.3.6.68

Adobe ColdFusion Version: CF11 and CF18

We experienced a StackOverflowError when recursively trying to convert an Xml document to a struct XmlToStruct(any), because had an if statement with: StructKeyExists(xmlData, "xmlRoot") which if true extracted the xmlRoot is passed it into XmlToStruct(any) again, unlike ACF the Xml Elements have XmlRoot.

We solved the StackOverflowError with IsXmlDoc(any).

We would like to know if this is a defect or expected behavior

Environment

None

Activity

Zac Spitzer 22 July 2022 at 15:49

(disabled)

Richard E 20 March 2021 at 21:01

 

In Adobe ColdFusion this returns:

StructKeyExists(y, "xmlRoot")? YES
StructKeyExists(y.xmlRoot, "xmlRoot")? NO

In Lucee this returns:

StructKeyExists(y, "xmlRoot")? true
StructKeyExists(y.xmlRoot, "xmlRoot")? true

Pothys - MitrahSoft 17 March 2021 at 14:58

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.159-SNAPSHOT also.
Yes, all the XML document XmlRoot has its own XmRoot.

I added a testcase to this ticket

Pull Request: https://github.com/lucee/Lucee/pull/1236

Rilwan 17 March 2021 at 10:10

"WARN","http-nio-8888-exec-1","03/12/2021","09:43:04","","{""Extended_Info"":"""",""Message"":""java.lang.StackOverflowError"",""Detail"":"""",""additional"":{},""TagContext"":[{""Raw_Trace"":""writelog_cfm$cf.udfCall(/writeLog.cfm:17)"",""codePrintPlain"":"""",""column"":0,""line"":17,""template"":""/writeLog.cfm"",""id"":""??"",""type"":""cfml"",""codePrintHTML"":""""},{""Raw_Trace"":""corp.utils.datatypeconvert_cfc$cf$1.udfCall3 …

 

Zac Spitzer 12 March 2021 at 12:23

Can you share the top of the stacktrace and a little cfml example?

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 12 March 2021 at 11:00
Updated 1 July 2023 at 15:36