activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r911145 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp
Date Wed, 17 Feb 2010 18:42:23 GMT
Author: tabish
Date: Wed Feb 17 18:42:22 2010
New Revision: 911145

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

Fix a buffer overrun error found with valgrind.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp?rev=911145&r1=911144&r2=911145&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterTest.cpp Wed
Feb 17 18:42:22 2010
@@ -112,8 +112,10 @@
     static const std::size_t INPUT_SIZE = 5;
 
     unsigned char outPutBuf[BUFFER_SIZE];
+    memset( outPutBuf, 0, BUFFER_SIZE );
     unsigned char byteArray[] = { 5, 2, 3, 7, 8 };
     unsigned char outPutInf[BUFFER_SIZE];
+    memset( outPutInf, 0, BUFFER_SIZE );
 
     std::size_t offSet = 1;
     std::size_t length = BUFFER_SIZE - 1;
@@ -153,7 +155,7 @@
         CPPUNIT_ASSERT_EQUAL( byteArray[i], outPutInf[i] );
     }
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Final decompressed data contained more bytes than original",
-                                  0, (int) outPutInf[BUFFER_SIZE] );
+                                  0, (int) outPutInf[BUFFER_SIZE-1] );
     infl.end();
 
     // Set of tests testing the boundaries of the offSet/length



Mime
View raw message