| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index cfce1ee9392a594905860c1e3c5027f6c39cb55e..56eb04cd52ffc7ec986f8969f5bb588c33d0b5a6 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/auto_reset.h"
|
| #include "base/command_line.h"
|
| #include "base/debug/alias.h"
|
| +#include "base/debug/asan_invalid_access.h"
|
| #include "base/debug/dump_without_crashing.h"
|
| #include "base/i18n/char_iterator.h"
|
| #include "base/metrics/histogram.h"
|
| @@ -262,6 +263,7 @@ NOINLINE static void MaybeTriggerAsanError(const GURL& url) {
|
| static const char kUseAfterFree[] = "/use-after-free";
|
| #if defined(SYZYASAN)
|
| static const char kCorruptHeapBlock[] = "/corrupt-heap-block";
|
| + static const char kCorruptHeap[] = "/corrupt-heap";
|
| #endif
|
| static const int kArraySize = 5;
|
|
|
| @@ -271,25 +273,20 @@ NOINLINE static void MaybeTriggerAsanError(const GURL& url) {
|
| if (!url.has_path())
|
| return;
|
|
|
| - scoped_ptr<int[]> array(new int[kArraySize]);
|
| std::string crash_type(url.path());
|
| - int dummy = 0;
|
| if (crash_type == kHeapOverflow) {
|
| - dummy = array[kArraySize];
|
| + base::AsanHeapOverflow();
|
| } else if (crash_type == kHeapUnderflow ) {
|
| - dummy = array[-1];
|
| + base::AsanHeapUnderflow();
|
| } else if (crash_type == kUseAfterFree) {
|
| - int* dangling = array.get();
|
| - array.reset();
|
| - dummy = dangling[kArraySize / 2];
|
| + base::AsanHeapUseAfterFree();
|
| #if defined(SYZYASAN)
|
| } else if (crash_type == kCorruptHeapBlock) {
|
| - CorruptMemoryBlock();
|
| + base::AsanCorruptHeapBlock();
|
| + } else if (crash_type == kCorruptHeap) {
|
| + base::AsanCorruptHeap();
|
| #endif
|
| }
|
| -
|
| - // Make sure the assignments to the dummy value aren't optimized away.
|
| - base::debug::Alias(&dummy);
|
| }
|
| #endif // ADDRESS_SANITIZER || SYZYASAN
|
|
|
|
|