dbertoni    00/08/27 18:14:40

  Modified:    c/src/PlatformSupport DOMStringPrintWriter.cpp
                        DOMStringPrintWriter.hpp
  Log:
  Make sure strings are always null-terminated.
  
  Revision  Changes    Path
  1.5       +8 -1      xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.cpp
  
  Index: DOMStringPrintWriter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMStringPrintWriter.cpp  2000/08/15 19:41:10     1.4
  +++ DOMStringPrintWriter.cpp  2000/08/28 01:14:40     1.5
  @@ -153,7 +153,14 @@
   void
   DOMStringPrintWriter::write(XalanDOMChar     c)
   {
  -     m_outputString += c;
  +     // Write the data as a null-terminated array,
  +     // so we can guarantee null-termination of our
  +     // string...
  +     XalanDOMChar    theBuffer[2] = { 0, 0 };
  +
  +     theBuffer[0] = c;
  +
  +     m_outputString += theBuffer;
   }
   
   
  
  
  
  1.7       +2 -0      xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.hpp
  
  Index: DOMStringPrintWriter.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMStringPrintWriter.hpp  2000/08/15 19:41:10     1.6
  +++ DOMStringPrintWriter.hpp  2000/08/28 01:14:40     1.7
  @@ -92,6 +92,8 @@
        {
                return m_outputString;
        }
  +
  +
        // Output functions inherited from PrintWriter...
   
        // Flush the stream, then check the error status.
  
  
  

Reply via email to