You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2004/07/08 21:34:23 UTC

cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMStringPool.cpp

amassari    2004/07/08 12:34:23

  Modified:    c/src/xercesc/dom/impl DOMStringPool.cpp
  Log:
  set() and append() were not NULL-terminating the buffer (jira#1236)
  
  Revision  Changes    Path
  1.8       +7 -1      xml-xerces/c/src/xercesc/dom/impl/DOMStringPool.cpp
  
  Index: DOMStringPool.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMStringPool.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DOMStringPool.cpp	29 Jan 2004 11:44:27 -0000	1.7
  +++ DOMStringPool.cpp	8 Jul 2004 19:34:23 -0000	1.8
  @@ -191,6 +191,9 @@
           expandCapacity(actualCount);
       memcpy(&fBuffer[fIndex], chars, actualCount * sizeof(XMLCh));
       fIndex += actualCount;
  +
  +    // Keep it null terminated
  +    fBuffer[fIndex] = 0;
   }
   
   void DOMBuffer::set(const XMLCh* const chars, const unsigned int count)
  @@ -203,6 +206,9 @@
           expandCapacity(actualCount);
       memcpy(fBuffer, chars, actualCount * sizeof(XMLCh));
       fIndex = actualCount;
  +
  +    // Keep it null terminated
  +    fBuffer[fIndex] = 0;
   }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org