| commit | 15a191151e3b19c6ae0d32f1cacce259076bbc55 | [log] [tgz] |
|---|---|---|
| author | Timothy A. Bish <tabish@apache.org> | Wed Mar 02 14:23:01 2011 +0000 |
| committer | Timothy A. Bish <tabish@apache.org> | Wed Mar 02 14:23:01 2011 +0000 |
| tree | a2fccdfea0ed324867e14158b44e646a15c60761 | |
| parent | c2f28f77c459a4405b1fe478bd507e3225de32b0 [diff] |
fix for: https://issues.apache.org/jira/browse/AMQCPP-353 git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-cpp/branches/activemq-cpp-3.2.x@1076229 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp index 9e33306..f3da241 100644 --- a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp +++ b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp
@@ -815,13 +815,17 @@ try{ - 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() ); + int size = dataIn->readShort(); + + 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; }