From 4c5d3eddf99fea6ba652a487d6e7690b51e8aa23 Mon Sep 17 00:00:00 2001 From: Adam Michalik Date: Tue, 13 Dec 2016 11:02:58 -0800 Subject: Fix integer overflow in FastUInt32ToBufferLeft If digits > 2, and int is 32 bit, line 999 overflows. It has been fixed internally in CL 41203823. --- src/google/protobuf/stubs/strutil.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/google') 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 (%), -- cgit v1.2.3