diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 18:08:29 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 18:08:29 +0000 |
commit | 025d744fa84358ea535ad6af5034c66fd9e4aa08 (patch) | |
tree | 77da93990259337e4bb2931cd5fd60ae8683b4c4 /webkit/plugins | |
parent | 48b6eea655b970acb922c92db6832883097fb0fd (diff) | |
download | chromium_src-025d744fa84358ea535ad6af5034c66fd9e4aa08.zip chromium_src-025d744fa84358ea535ad6af5034c66fd9e4aa08.tar.gz chromium_src-025d744fa84358ea535ad6af5034c66fd9e4aa08.tar.bz2 |
Coverity: Fix null dereference errors
CID=102794
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8989042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/message_channel.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/message_channel.cc b/webkit/plugins/ppapi/message_channel.cc index 7eef69e..f139114 100644 --- a/webkit/plugins/ppapi/message_channel.cc +++ b/webkit/plugins/ppapi/message_channel.cc @@ -134,7 +134,13 @@ PP_Var CopyPPVar(const PP_Var& var) { return PP_MakeUndefined(); PP_Var new_buffer_var = PpapiGlobals::Get()->GetVarTracker()-> MakeArrayBufferPPVar(buffer->ByteLength()); + DCHECK(new_buffer_var.type == PP_VARTYPE_ARRAY_BUFFER); + if (new_buffer_var.type != PP_VARTYPE_ARRAY_BUFFER) + return PP_MakeUndefined(); ArrayBufferVar* new_buffer = ArrayBufferVar::FromPPVar(new_buffer_var); + DCHECK(new_buffer); + if (!new_buffer) + return PP_MakeUndefined(); memcpy(new_buffer->Map(), buffer->Map(), buffer->ByteLength()); return new_buffer_var; } else { @@ -420,4 +426,3 @@ void MessageChannel::SetPassthroughObject(NPObject* passthrough) { } // namespace ppapi } // namespace webkit - |