Skip to content

Commit

Permalink
Fix segmentation fault when login can not be determined
Browse files Browse the repository at this point in the history
  • Loading branch information
Cropi committed Apr 29, 2020
1 parent 8ddd560 commit d5b32fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Notifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace usbguardNotifier
Notifier::Notifier(const std::string& app_name) :
_lib(app_name)
{
std::string path(std::string(NOTIFICATION_DIR) + "/" + std::string(getlogin()));
std::string login = getlogin() ? getlogin() : "unknown";
std::string path(std::string(NOTIFICATION_DIR) + "/" + login);
_ser.setFileName(path);
}

Expand Down

0 comments on commit d5b32fc

Please sign in to comment.