Skip to content

Conversation

dmedora
Copy link

@dmedora dmedora commented Apr 23, 2024

At present, there is no check to ensure std::getenv has returned a non-null value in detail::getenv

return std::getenv(env_var);
.

If it is unable to find the APPDATA or HOME env var, it returns a nullptr. appdata_path then tries to use this nullptr to build a string. Updated appdata_path to log an error if a nullptr is returned.

(Context: ran into an issue with this while using LightGBM where the program was unexpectedly crashing without any error due to $HOME not being set.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants