diff options
author | Håvard Pettersen <havardpe@yahooinc.com> | 2022-06-21 11:26:58 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@yahooinc.com> | 2022-06-21 14:15:01 +0000 |
commit | 60e28dcd0b4c1ea9eff2e4f26da7ec53ed24e64a (patch) | |
tree | 80a479d5f62a8bb7c5ce52a5d531a434075cfe57 /searchlib/src/tests/docstore | |
parent | 1f9c4d5b83b314785cd9c83bbecec21cb00b192b (diff) |
avoid nullptr deref
Diffstat (limited to 'searchlib/src/tests/docstore')
-rw-r--r-- | searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp index fffa1778c85..0865e2c199a 100644 --- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp +++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp @@ -18,6 +18,7 @@ #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/size_literals.h> +#include <vespa/vespalib/util/memory.h> #include <iomanip> using document::BucketId; @@ -275,7 +276,7 @@ void fetchAndTest(IDataStore & datastore, uint32_t lid, const void *a, size_t sz vespalib::DataBuffer buf; EXPECT_EQUAL(static_cast<ssize_t>(sz), datastore.read(lid, buf)); EXPECT_EQUAL(buf.getDataLen(), sz); - EXPECT_TRUE(memcmp(a, buf.getData(), sz) == 0); + EXPECT_TRUE(vespalib::memcmp_safe(a, buf.getData(), sz) == 0); } TEST("testTruncatedIdxFile"){ |