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;
     }