Skip to content

Commit

Permalink
fix -Werror=format-security (#53886)
Browse files Browse the repository at this point in the history
  • Loading branch information
engineer1109 authored May 18, 2023
1 parent 92121d1 commit 6d7076c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ class CustomPluginCreater : public OpConverter {

// NOTE: to avoid string rewrite by iterator, deep copy here
std::vector<char> plugin_attr_name(attr_name.length() + 1, 0);
snprintf(
plugin_attr_name.data(), attr_name.length() + 1, attr_name.c_str());
snprintf(plugin_attr_name.data(),
attr_name.length() + 1,
"%s",
attr_name.c_str());
plugindata.name = plugin_attr_name.data();

if (op_desc.GetAttrType(attr_name) == framework::proto::AttrType::INT) {
Expand Down

0 comments on commit 6d7076c

Please sign in to comment.