!33691 fix security function

Merge pull request !33691 from yeyunpeng2020/master
This commit is contained in:
i-robot 2022-04-28 10:58:30 +00:00 committed by Gitee
commit 56a74ddeba
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 4 additions and 7 deletions

View File

@ -371,9 +371,12 @@ int RunConverter(int argc, const char **argv) {
}
}
// clear key
flags->dec_key.clear();
flags->encKeyStr.clear();
status = memset_s(flags->encKey, converter::kEncMaxLen, 0, converter::kEncMaxLen);
if (status != EOK) {
MS_LOG(ERROR) << "memset failed.";
delete meta_graph;
return RET_ERROR;
}
delete meta_graph;

View File

@ -527,12 +527,6 @@ int Flags::Init(int argc, const char **argv) {
return RET_OK;
}
Flags::~Flags() {
dec_key.clear();
encKeyStr.clear();
memset(encKey, 0, kEncMaxLen);
}
bool CheckOfflineParallelConfig(const std::string &file, ParallelSplitConfig *parallel_split_config) {
// device: [device0 device1] ---> {cpu, gpu}
// computeRate: [x: y] x >=0 && y >=0 && x/y < 10

View File

@ -51,7 +51,7 @@ class Flags : public virtual mindspore::lite::FlagParser {
public:
Flags();
~Flags() override;
~Flags() = default;
int InitInputOutputDataType();