Index: third_party/protobuf/src/google/protobuf/stubs/substitute.cc |
diff --git a/third_party/protobuf/src/google/protobuf/stubs/substitute.cc b/third_party/protobuf/src/google/protobuf/stubs/substitute.cc |
index c9d95899f5249c8d25076898c4ceba419cc6cd49..7194a5b171e9ef00e4af06dccd025d833f00185f 100644 |
--- a/third_party/protobuf/src/google/protobuf/stubs/substitute.cc |
+++ b/third_party/protobuf/src/google/protobuf/stubs/substitute.cc |
@@ -113,7 +113,9 @@ void SubstituteAndAppend( |
for (int i = 0; format[i] != '\0'; i++) { |
if (format[i] == '$') { |
if (ascii_isdigit(format[i+1])) { |
- const SubstituteArg* src = args_array[format[i+1] - '0']; |
+ unsigned int index = format[i+1] - '0'; |
+ assert(index < 10); |
+ const SubstituteArg* src = args_array[index]; |
memcpy(target, src->data(), src->size()); |
target += src->size(); |
++i; // Skip next char. |