Merge pull request #12653 from wjwithagen/wjw-wip-denc-raw

src/test/test_denc.cc: Fix errors in buffer overflow

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
This commit is contained in:
Sage Weil 2016-12-23 23:16:21 -06:00 committed by GitHub
commit 78736d5410

View File

@ -45,7 +45,7 @@ void test_denc(T v) {
// encode
bufferlist bl;
{
auto a = bl.get_contiguous_appender(sizeof(T) * 3);
auto a = bl.get_contiguous_appender(s);
denc(v, a);
}
ASSERT_LE(bl.length(), s);
@ -82,7 +82,7 @@ void test_denc_featured(T v) {
// encode
bufferlist bl;
{
auto a = bl.get_contiguous_appender(sizeof(T) * 3);
auto a = bl.get_contiguous_appender(s);
denc(v, a, 1);
}
ASSERT_LE(bl.length(), s);