Skip to content

Commit

Permalink
Check that a valid RawVarData has been created before calling a funct…
Browse files Browse the repository at this point in the history
…ion on it

Currently the PP_Var type that is deserialized from an incoming IPC
is invalid, RawVarData::Create will return a nullptr which we will
try to call a function on. Instead we should just fail to deserialize
the entire message in that case.

BUG=693007

Review-Url: https://codereview.chromium.org/2705933002
Cr-Commit-Position: refs/heads/master@{#451541}
  • Loading branch information
raymes authored and Commit bot committed Feb 20, 2017
1 parent 813de38 commit d0dfa19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ppapi/proxy/raw_var_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ std::unique_ptr<RawVarDataGraph> RawVarDataGraph::Read(
return nullptr;
PP_VarType var_type = static_cast<PP_VarType>(type);
result->data_.push_back(base::WrapUnique(RawVarData::Create(var_type)));
if (!result->data_.back())
return nullptr;
if (!result->data_.back()->Read(var_type, m, iter))
return nullptr;
}
Expand Down

0 comments on commit d0dfa19

Please sign in to comment.