Commit 98b92d99 authored by Ben Wagner's avatar Ben Wagner Committed by Commit Bot

filter_fuzz_stub to crash on unsatisfiable new.

By default Chromium's global operator new will return nullptr for
unsatisfiable requests. Chromium changes this behavior by calling
base::EnableTerminationOnOutOfMemory() to set a new_hanlder which will
properly abort. All fuzzers should also do this to match this behavior.
This updates filter_fuzz_stub to make this call, but other fuzzers may
also need to be updated.

BUG=chromium:763213

Change-Id: Ic112ba15f9ed96e4c9412a7c52737d8489d6c615
Reviewed-on: https://chromium-review.googlesource.com/677546Reviewed-by: default avatarPrimiano Tucci <primiano@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Reviewed-by: default avatarBen Wagner <bungeman@chromium.org>
Commit-Queue: Ben Wagner <bungeman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504046}
parent 78991fbe
......@@ -4,6 +4,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/process/memory.h"
#include "base/test/test_discardable_memory_allocator.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
......@@ -73,6 +74,7 @@ bool ReadAndRunTestCase(const char* filename, SkBitmap& bitmap,
int main(int argc, char** argv) {
int ret = 0;
base::EnableTerminationOnOutOfMemory();
base::TestDiscardableMemoryAllocator discardable_memory_allocator;
base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment