Skip to content

Commit

Permalink
Fixed the possible crash(heap-use-after-free). (vesoft-inc#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
monadbobo authored and dutor committed Nov 6, 2019
1 parent 2400332 commit 92ccf1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/meta/processors/configMan/SetConfigProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ void SetConfigProcessor::setNestedConfig(const cpp2::ConfigModule& module, const
LOG(ERROR) << "Should not reach here";
continue;
}
auto key = field.substr(0, pos).c_str();
auto key = field.substr(0, pos);
auto value = field.substr(pos + 1);
// TODO: Maybe need to handle illegal value here
if (mutableFields_.count(key) && conf.updateStringField(key, value).ok()) {
if (mutableFields_.count(key) && conf.updateStringField(key.c_str(), value).ok()) {
updated = true;
}
}
Expand Down

0 comments on commit 92ccf1a

Please sign in to comment.