activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r505583 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
Date Sat, 10 Feb 2007 00:35:01 GMT
Author: tabish
Date: Fri Feb  9 16:35:00 2007
New Revision: 505583

URL: http://svn.apache.org/viewvc?view=rev&rev=505583
Log:
http://issues.apache.org/activemq/browse/AMQCPP-30

Fix a memory write out of bounds error.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp?view=diff&rev=505583&r1=505582&r2=505583
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
Fri Feb  9 16:35:00 2007
@@ -823,13 +823,13 @@
         int size = dataIn->readShort() + 1; // add space c++ NULL
         unsigned char* data = new unsigned char[size];        
         dataIn->readFully( data, 0, size-1 );
-        data[size] = 0;  // enforce NULL
+        data[size-1] = 0;  // enforce NULL
         
         // Now build a string and copy data into it.
         std::string text;
         text.resize( size );
         text.assign( (char*)data, (int)size-1 );
-        delete data;
+        delete [] data;
         
         return text; 
     }



Mime
View raw message