Author: tabish
Date: Wed Mar 2 14:23:01 2011
New Revision: 1076229
URL: http://svn.apache.org/viewvc?rev=1076229&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQCPP-353
Modified:
activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp
Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp?rev=1076229&r1=1076228&r2=1076229&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp
Wed Mar 2 14:23:01 2011
@@ -815,13 +815,17 @@ std::string BaseDataStreamMarshaller::re
try{
+ std::string text;
int size = dataIn->readShort();
- std::vector<char> data( size );
- dataIn->readFully( (unsigned char*)&data[0], size );
- // Now build a string and copy data into it.
- std::string text;
- text.insert( text.begin(), data.begin(), data.end() );
+ if( size > 0 ) {
+
+ std::vector<char> data( size );
+ dataIn->readFully( (unsigned char*)&data[0], size );
+
+ // Now build a string and copy data into it.
+ text.insert( text.begin(), data.begin(), data.end() );
+ }
return text;
}
|