Skip to content

Commit

Permalink
Fix OOB write in grappler.
Browse files Browse the repository at this point in the history
Discovered via internal fuzzing.

PiperOrigin-RevId: 482097391
  • Loading branch information
mihaimaruseac authored and tensorflow-jenkins committed Oct 20, 2022
1 parent f578805 commit c1b2cc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/grappler/utils/functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ Status MakeGrapplerFunctionItem(const FunctionDef& func,

std::vector<const FunctionDef::ArgAttrs*> arg_attr(inputs.size(), nullptr);
for (const auto& attr : func.arg_attr()) {
if (attr.first >= inputs.size()) {
return errors::InvalidArgument("Invalid attribute index, got ",
attr.first, " but expected less than ",
inputs.size());
}
arg_attr.at(attr.first) = &attr.second;
}

Expand Down

0 comments on commit c1b2cc4

Please sign in to comment.