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

Unified Diff: core/src/fxcrt/fx_safe_types.h

Issue 896023003: Prevent base::CheckedNumeric from leaking outside of pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add name of new .h to build files. Created 5 years, 11 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/src/fxcrt/extension.h ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_safe_types.h
diff --git a/core/src/fxcrt/fx_safe_types.h b/core/src/fxcrt/fx_safe_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..794e1f19dc1ce3972be41b2c6a0b3605a5399810
--- /dev/null
+++ b/core/src/fxcrt/fx_safe_types.h
@@ -0,0 +1,17 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FX_SAFE_TYPES_H_
+#define FX_SAFE_TYPES_H_
+
+#include <stdlib.h> // For size_t.
+
+#include "../../../third_party/numerics/safe_math.h"
+
+typedef base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
+typedef base::CheckedNumeric<FX_INT32> FX_SAFE_INT32;
+typedef base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
+typedef base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE;
+
+#endif // FX_SAFE_TYPES_H_
« no previous file with comments | « core/src/fxcrt/extension.h ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698