Skip to content

Commit

Permalink
Merge pull request #1300 from sinotca529/fix_getFilePath
Browse files Browse the repository at this point in the history
bugfix: check return value of getenv
  • Loading branch information
yuleisui authored Dec 23, 2023
2 parents 90a0715 + 8f33f96 commit a6f6832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions svf/lib/Util/ExtAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ static std::string getFilePath(const std::string& path)
std::string bcFilePath = "";
if (path.compare("SVF_DIR") == 0)
{
bcFilePath = getenv("SVF_DIR");
char const* svfdir = getenv("SVF_DIR");
if (svfdir)
bcFilePath = svfdir;
}
else if (path.compare("npm root") == 0)
{
Expand Down Expand Up @@ -229,4 +231,4 @@ bool ExtAPI::is_ext(const SVFFunction* F)
return false;
else
return !F->getAnnotations().empty();
}
}

0 comments on commit a6f6832

Please sign in to comment.