Skip to content
Permalink
Browse files Browse the repository at this point in the history
Quick fix for a vuln in printing empty tensors.
PiperOrigin-RevId: 503308327
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Jan 20, 2023
1 parent c9666f7 commit 6d423b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tensorflow/core/framework/tensor.cc
Expand Up @@ -1297,6 +1297,9 @@ template <>
string SummarizeArray<bool>(int64_t limit, int64_t num_elts,
const TensorShape& tensor_shape, const char* data,
const bool print_v2) {
if (data == nullptr) {
return strings::StrCat(""); // we already print type and shape
}
// We first convert all chars to be 0/1 to not get InvalidEnumValue sanitizer
// error
auto mutable_data = std::unique_ptr<char[]>(new char[num_elts]);
Expand Down

0 comments on commit 6d423b8

Please sign in to comment.