Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: core/include/fxcrt/fx_system.h

Issue 419063002: Fix the potential integer overflow from 'offset+size' in extension.h and fpdfview.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_stream.h ('k') | core/src/fxcrt/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_system.h
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index 7488e9d2dc6cff2f4e07dd89351d8d9c0282e882..391380304c936a302a77d2d5fef41e3110687e8e 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -276,6 +276,10 @@ int FXSYS_round(FX_FLOAT f);
#ifdef __cplusplus
};
+#include "../../../third_party/numerics/safe_math.h"
+typedef base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
+typedef base::CheckedNumeric<FX_INT32> FX_SAFE_INT;
+typedef base::CheckedNumeric<size_t> FX_SAFE_SIZET;
Tom Sepez 2014/07/31 18:46:42 nit: Just to be pedantic, I'd have called this FX_
#if defined(__clang__) || _MSC_VER >= 1700
#define FX_FINAL final
#elif defined(__GNUC__) && __cplusplus >= 201103 && \
« no previous file with comments | « core/include/fxcrt/fx_stream.h ('k') | core/src/fxcrt/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698