[ https://issues.apache.org/jira/browse/XERCESC-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Scott Cantor updated XERCESC-1978: ---------------------------------- Remaining Estimate: (was: 2h) Original Estimate: (was: 2h) > DOMDocumentImpl:: getPooledNString(const XMLCh *in, XMLSize_t n) returns > incorrect string > ----------------------------------------------------------------------------------------- > > Key: XERCESC-1978 > URL: https://issues.apache.org/jira/browse/XERCESC-1978 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM > Affects Versions: 3.1.1 > Environment: Windows x32, but should be everywhere > Reporter: Rainer Prosi > Assignee: Alberto Massari > Priority: Blocker > Fix For: 3.1.2, 3.2.0 > > > the methods returns the original string rather than the substring(n) if the > substring and original string have the same hash code. > This leeds to corrupt xml files due to prefixes being replaced by the entire > string: > Original version: > while (*pspe != 0) > { > if (XMLString::equals((*pspe)->fString, in)) > return (*pspe)->fString; > ... > Bugfix suggestion: > //RP 120416 we need to check for length of the returned <=n; else any hash > matching string longer than n will be accepted --- bad snafu! > if (XMLString::equalsN((*pspe)->fString, in, n) && XMLString::stringLen( > (*pspe)->fString)<=n) > Example prefix + attribute name that will fail: > HDM: > HDM:OffsetBack -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org