mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-14 23:07:58 +02:00
Fix malloc size
This commit is contained in:
@@ -269,9 +269,9 @@ TEST(MSGPACK, vref_buffer_overflow)
|
|||||||
{
|
{
|
||||||
size_t ref_size = 0;
|
size_t ref_size = 0;
|
||||||
size_t chunk_size = std::numeric_limits<size_t>::max();
|
size_t chunk_size = std::numeric_limits<size_t>::max();
|
||||||
char *buf = (char *)malloc(chunk_size);
|
char *buf = (char *)malloc(0x1000);
|
||||||
ASSERT_THROW(msgpack::vrefbuffer vbuf(ref_size, chunk_size), std::bad_alloc);
|
ASSERT_THROW(msgpack::vrefbuffer vbuf(ref_size, chunk_size), std::bad_alloc);
|
||||||
// msgpack::vrefbuffer vbuf2(0, 0x1000);
|
msgpack::vrefbuffer vbuf2(0, 0x1000);
|
||||||
// ASSERT_THROW(vbuf2.append_copy(buf, chunk_size), std::bad_alloc);
|
ASSERT_THROW(vbuf2.append_copy(buf, chunk_size), std::bad_alloc);
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user