Skip to content

Commit

Permalink
XERCESC-1978
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/xerces/c/branches/xerces-3.1@1662888 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Scott Cantor committed Feb 28, 2015
1 parent 26c72fe commit 8bdfd96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xercesc/dom/impl/DOMDocumentImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,16 @@ inline const XMLCh* DOMDocumentImpl::getPooledString(const XMLCh *in)
// declared in the struct, so we don't need to add one again to
// account for the trailing null.
//
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + XMLString::stringLen(in)*sizeof(XMLCh);
XMLSize_t n = XMLString::stringLen(in);
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + n*sizeof(XMLCh);
*pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate);
spe->fNext = 0;
XMLString::copyString((XMLCh*)spe->fString, in);

return spe->fString;
}

inline const XMLCh* DOMDocumentImpl::
getPooledNString(const XMLCh *in, XMLSize_t n)
inline const XMLCh* DOMDocumentImpl::getPooledNString(const XMLCh *in, XMLSize_t n)
{
if (in == 0)
return 0;
Expand All @@ -401,7 +401,7 @@ getPooledNString(const XMLCh *in, XMLSize_t n)
pspe = &fNameTable[inHash];
while (*pspe != 0)
{
if (XMLString::equalsN((*pspe)->fString, in, n))
if (XMLString::stringLen((*pspe)->fString) == n && XMLString::equalsN((*pspe)->fString, in, n))
return (*pspe)->fString;
pspe = &((*pspe)->fNext);
}
Expand Down

0 comments on commit 8bdfd96

Please sign in to comment.