From f05bb553036cf067637ca20223065a8f652df90b Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 13 Feb 2014 18:52:55 +0000 Subject: [PATCH] Don't crash when installing a service. install_service() calls edit_service() with a null username, causing well_known_username() to segfault. Thanks Czenda Czendov. --- account.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/account.cpp b/account.cpp index 5e6523f..19dc66e 100644 --- a/account.cpp +++ b/account.cpp @@ -166,6 +166,7 @@ const TCHAR *well_known_sid(SID *sid) { } const TCHAR *well_known_username(const TCHAR *username) { + if (! username) return NSSM_LOCALSYSTEM_ACCOUNT; if (str_equiv(username, NSSM_LOCALSYSTEM_ACCOUNT)) return NSSM_LOCALSYSTEM_ACCOUNT; SID *sid; int r = username_sid(username, &sid); -- 2.20.1