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

Unified Diff: gpu/ipc/gpu_command_buffer_traits.cc

Issue 1383463005: Fix array out of bounds access in loop iteration in gpu ipc log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/gpu_command_buffer_traits.cc
diff --git a/gpu/ipc/gpu_command_buffer_traits.cc b/gpu/ipc/gpu_command_buffer_traits.cc
index 8d2148de0f7842d9741cbb61ba6fed3f18450810..72bc6333fac08bb9b328f746f8ff9ee90e8da624 100644
--- a/gpu/ipc/gpu_command_buffer_traits.cc
+++ b/gpu/ipc/gpu_command_buffer_traits.cc
@@ -115,10 +115,10 @@ bool ParamTraits<gpu::ValueState> ::Read(const Message* m,
void ParamTraits<gpu::ValueState>::Log(const param_type& p, std::string* l) {
l->append("<ValueState (");
- for (size_t i = 0; i < sizeof(p.int_value); ++i)
+ for (size_t i = 0; i < sizeof(p.int_value) / sizeof(p.int_value[0]); ++i)
piman 2015/10/06 20:04:45 nit: Can you use arraysize here? Or even better us
RaviKasibhatla 2015/10/07 11:58:34 Done.
*l += base::StringPrintf("%i ", p.int_value[i]);
l->append(" int values ");
- for (size_t i = 0; i < sizeof(p.float_value); ++i)
+ for (size_t i = 0; i < sizeof(p.float_value) / sizeof(p.float_value[0]); ++i)
piman 2015/10/06 20:04:45 nit: same here.
RaviKasibhatla 2015/10/07 11:58:33 Done.
*l += base::StringPrintf("%f ", p.float_value[i]);
l->append(" float values)>");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698