Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: check return value of getenv #1300

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
std::string bcFilePath = "";
if (path.compare("SVF_DIR") == 0)
{
bcFilePath = getenv("SVF_DIR");
char const* svfdir = getenv("SVF_DIR");
if (svfdir)

Check warning on line 101 in svf/lib/Util/ExtAPI.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/Util/ExtAPI.cpp#L100-L101

Added lines #L100 - L101 were not covered by tests
bcFilePath = svfdir;
}
else if (path.compare("npm root") == 0)
{
Expand Down Expand Up @@ -229,4 +231,4 @@
return false;
else
return !F->getAnnotations().empty();
}
}
Loading