Skip to content

Commit 349c133

Browse files
jwangtbeu
authored andcommitted
Fix malloc size
1 parent c056026 commit 349c133

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/msgpack_vref.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ TEST(MSGPACK, vrefbuffer_small_int64)
267267

268268
TEST(MSGPACK, vref_buffer_overflow)
269269
{
270-
size_t ref_size = 0;
270+
size_t ref_size = 0;
271271
size_t chunk_size = std::numeric_limits<size_t>::max();
272-
char *buf = (char *)malloc(chunk_size);
272+
char *buf = (char *)malloc(0x1000);
273273
ASSERT_THROW(msgpack::vrefbuffer vbuf(ref_size, chunk_size), std::bad_alloc);
274-
// msgpack::vrefbuffer vbuf2(0, 0x1000);
275-
// ASSERT_THROW(vbuf2.append_copy(buf, chunk_size), std::bad_alloc);
274+
msgpack::vrefbuffer vbuf2(0, 0x1000);
275+
ASSERT_THROW(vbuf2.append_copy(buf, chunk_size), std::bad_alloc);
276276
free(buf);
277277
}

0 commit comments

Comments
 (0)