diff options
author | Adam Michalik <xyzzyz@google.com> | 2016-12-13 11:02:58 -0800 |
---|---|---|
committer | Adam Michalik <xyzzyz@google.com> | 2016-12-13 11:02:58 -0800 |
commit | 4c5d3eddf99fea6ba652a487d6e7690b51e8aa23 (patch) | |
tree | 4f3150aae546db23eac5c43c5cd1fecb243b9a39 /src/google/protobuf/stubs/strutil.cc | |
parent | 9d709f446f18b672edff81ee2d3f9d6516465d8c (diff) | |
download | protobuf-4c5d3eddf99fea6ba652a487d6e7690b51e8aa23.tar.gz protobuf-4c5d3eddf99fea6ba652a487d6e7690b51e8aa23.tar.bz2 protobuf-4c5d3eddf99fea6ba652a487d6e7690b51e8aa23.zip |
Fix integer overflow in FastUInt32ToBufferLeft
If digits > 2, and int is 32 bit, line 999 overflows. It has been fixed
internally in CL 41203823.
Diffstat (limited to 'src/google/protobuf/stubs/strutil.cc')
-rw-r--r-- | src/google/protobuf/stubs/strutil.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc index 4fa8e99f..15b6e53f 100644 --- a/src/google/protobuf/stubs/strutil.cc +++ b/src/google/protobuf/stubs/strutil.cc @@ -981,7 +981,7 @@ static const char two_ASCII_digits[100][2] = { }; char* FastUInt32ToBufferLeft(uint32 u, char* buffer) { - int digits; + uint32 digits; const char *ASCII_digits = NULL; // The idea of this implementation is to trim the number of divides to as few // as possible by using multiplication and subtraction rather than mod (%), |