Fix segfault when using a blank or extremely short source parameter
This commit is contained in:
parent
8d623e9609
commit
b8caa9c398
1 changed files with 2 additions and 2 deletions
|
@ -703,7 +703,7 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
|
|||
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
||||
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
||||
|
||||
if (tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||
if (tmpFn.size() >= front.size()+back.size() && tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||
if (tmp_input.getMember("non-provider") && !isProvider){
|
||||
noProviderNoPick = true;
|
||||
continue;
|
||||
|
@ -720,7 +720,7 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
|
|||
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
||||
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
||||
|
||||
if (tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||
if (tmpFn.size() >= front.size()+back.size() && tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||
if (tmp_input.getMember("non-provider") && !isProvider){
|
||||
noProviderNoPick = true;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue