Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: third_party/protobuf/src/google/protobuf/stubs/substitute.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
« no previous file with comments | « third_party/protobuf/src/google/protobuf/stubs/strutil.cc ('k') | third_party/protobuf/src/google/protobuf/stubs/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698