From 2d282243dbd1edd51d42e13f563903a1a76ce8f8 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 19 Sep 2014 15:58:46 -0700 Subject: Fix a bug when assign the generation number of indirect objects BUG=408532 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/524443002 --- core/src/fxcrt/fx_basic_gcc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/src/fxcrt/fx_basic_gcc.cpp') diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp index 7f5bbade66..93c71ce660 100644 --- a/core/src/fxcrt/fx_basic_gcc.cpp +++ b/core/src/fxcrt/fx_basic_gcc.cpp @@ -4,6 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include #include "../../include/fxcrt/fx_ext.h" template T FXSYS_StrToInt(STR_T str) @@ -21,6 +22,9 @@ T FXSYS_StrToInt(STR_T str) if ((*str) < '0' || (*str) > '9') { break; } + if (num > (std::numeric_limits::max() - 9) / 10) { + break; + } num = num * 10 + (*str) - '0'; str ++; } -- cgit v1.2.3