commit | 26b286760c373082683e758358f36f2dfdafd629 | [log] [tgz] |
---|---|---|
author | Tom Sepez <tsepez@chromium.org> | Thu Sep 13 18:18:44 2018 +0000 |
committer | Chromium commit bot <commit-bot@chromium.org> | Thu Sep 13 18:18:44 2018 +0000 |
tree | be7bc0b3e7b2f5d28845e3acfc45893c4e6263ab | |
parent | 882ed81dec7afc5bc106f965af34f1e59407fd95 [diff] |
Test that FX_TryRealloc failure leaves original contents intact Change-Id: I2b1e5cc7a9576b5bb3bf3888225d1f6e54e0c95b Reviewed-on: https://pdfium-review.googlesource.com/42051 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/fx_memory_unittest.cpp b/core/fxcrt/fx_memory_unittest.cpp index 8036855..8c57783 100644 --- a/core/fxcrt/fx_memory_unittest.cpp +++ b/core/fxcrt/fx_memory_unittest.cpp
@@ -68,7 +68,9 @@ ptr = FX_Alloc(int, 1); EXPECT_TRUE(ptr); + *ptr = 1492; // Arbitrary sentinel. EXPECT_FALSE(FX_TryRealloc(int, ptr, kOverflowIntAlloc)); + EXPECT_EQ(1492, *ptr); FX_Free(ptr); } #endif