aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Michalik <xyzzyz@google.com>2016-12-13 11:02:58 -0800
committerGravatar Adam Michalik <xyzzyz@google.com>2016-12-13 11:02:58 -0800
commit4c5d3eddf99fea6ba652a487d6e7690b51e8aa23 (patch)
tree4f3150aae546db23eac5c43c5cd1fecb243b9a39 /src
parent9d709f446f18b672edff81ee2d3f9d6516465d8c (diff)
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')
-rw-r--r--src/google/protobuf/stubs/strutil.cc2
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 (%),