THRIFT-4376: fix more high impact coverity defects
Led to the discovery of incorrect lua socket error handling.
This closes #1405
diff --git a/lib/cpp/test/TBufferBaseTest.cpp b/lib/cpp/test/TBufferBaseTest.cpp
index 4e3509e..4201ddb 100644
--- a/lib/cpp/test/TBufferBaseTest.cpp
+++ b/lib/cpp/test/TBufferBaseTest.cpp
@@ -567,7 +567,7 @@
for (int d1 = 0; d1 < 3; d1++) {
shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer(16));
TFramedTransport trans(buffer, size);
- uint8_t data_out[1<<15];
+ std::vector<uint8_t> data_out(1<<17, 0);
std::vector<int> flush_sizes;
int write_offset = 0;
@@ -605,7 +605,7 @@
}
BOOST_CHECK_EQUAL((unsigned int)read_offset, sizeof(data));
- BOOST_CHECK(!memcmp(data, data_out, sizeof(data)));
+ BOOST_CHECK(!memcmp(data, &data_out[0], sizeof(data)));
}
}
}