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

PiperOrigin-RevId: 482097391
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Oct 19, 2022
1 parent 4a08a44 commit a65411a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/grappler/utils/functions.cc
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 a65411a

Please sign in to comment.