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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 822953002: Validate Bucket data in ShaderSourceBucket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« 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/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 9ad567a0cca020744f954861b956303151992022..4fb84aa716b2b487b5b69332b8a52e3c825aeca9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -7090,6 +7090,11 @@ error::Error GLES2DecoderImpl::HandleShaderSourceBucket(
if (!bucket || bucket->size() == 0) {
return error::kInvalidArguments;
}
+
+ if (!bucket->GetData(0, bucket->size() - 1)) {
Zhenyao Mo 2014/12/31 00:13:47 Good catch. But instead of checking it here, it m
sivag 2014/12/31 11:22:19 Done.
+ return error::kOutOfBounds;
+ }
+
return ShaderSourceHelper(
c.shader, bucket->GetDataAs<const char*>(0, bucket->size() - 1),
bucket->size() - 1);
« 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