aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2016-12-13 15:19:34 -0800
committerGravatar GitHub <noreply@github.com>2016-12-13 15:19:34 -0800
commitf983302ca7051bd1364a6ea9218e21040e4a851b (patch)
tree5b0302cd89bb8ff5e120a28ea2ec082c6b754b78 /src
parent837fd6b6a09d35440959222d2797bc7dd626c1e4 (diff)
parent4c5d3eddf99fea6ba652a487d6e7690b51e8aa23 (diff)
Merge pull request #2496 from xyzzyz/fix-overflow
Fix integer overflow in FastUInt32ToBufferLeft
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 (%),