git://git.iain.cx/iain
/
nssm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
db7dde3
)
Don't crash when installing a service.
author
Iain Patterson
<me@iain.cx>
Thu, 13 Feb 2014 18:52:55 +0000
(18:52 +0000)
committer
Iain Patterson
<me@iain.cx>
Thu, 13 Feb 2014 18:52:55 +0000
(18:52 +0000)
install_service() calls edit_service() with a null username, causing
well_known_username() to segfault.
Thanks Czenda Czendov.
account.cpp
patch
|
blob
|
history
diff --git
a/account.cpp
b/account.cpp
index
5e6523f
..
19dc66e
100644
(file)
--- 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);