activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r959300 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp test/activemq/commands/ActiveMQMapMessageTest.cpp
Date Wed, 30 Jun 2010 13:27:14 GMT
Author: tabish
Date: Wed Jun 30 13:27:13 2010
New Revision: 959300

URL: http://svn.apache.org/viewvc?rev=959300&view=rev
Log:
fix for: https://issues.apache.org/activemq/browse/AMQCPP-301

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMapMessageTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp?rev=959300&r1=959299&r2=959300&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp
Wed Jun 30 13:27:13 2010
@@ -397,8 +397,10 @@ PrimitiveValueNode PrimitiveTypesMarshal
             {
                 int size = dataIn.readInt();
                 std::vector<unsigned char> data;
-                data.resize( size );
-                dataIn.readFully( &data[0], size );
+                if( size > 0 ) {
+                    data.resize( size );
+                    dataIn.readFully( &data[0], size );
+                }
                 value.setByteArray( data );
                 break;
             }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMapMessageTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMapMessageTest.cpp?rev=959300&r1=959299&r2=959300&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMapMessageTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMapMessageTest.cpp
Wed Jun 30 13:27:13 2010
@@ -277,6 +277,10 @@ void ActiveMQMapMessageTest::testGetByte
         ex.printStackTrace();
         CPPUNIT_ASSERT( false );
     }
+
+    ActiveMQMapMessage msg3;
+    msg3.setBytes( "empty", std::vector<unsigned char>() );
+    CPPUNIT_ASSERT_NO_THROW( msg3.getBytes( "empty" ) );
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message