git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a9d003
)
nsswitch: Handle possible NULL return value of getprogname()
author
Andreas Schneider
<asn@samba.org>
Mon, 12 Nov 2018 14:47:46 +0000
(15:47 +0100)
committer
Andreas Schneider
<asn@cryptomilk.org>
Tue, 13 Nov 2018 06:37:25 +0000
(07:37 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
nsswitch/wb_common.c
patch
|
blob
|
history
diff --git
a/nsswitch/wb_common.c
b/nsswitch/wb_common.c
index 6eea32c7e2a9732ebd8652b09b80adf61ba6a206..f2672fb129875ce079cbdec6d858a0b67ff87ff7 100644
(file)
--- a/
nsswitch/wb_common.c
+++ b/
nsswitch/wb_common.c
@@
-89,14
+89,19
@@
void winbind_set_client_name(const char *name)
static const char *winbind_get_client_name(void)
{
if (client_name[0] == '\0') {
+ const char *progname = getprogname();
int len;
+ if (progname == NULL) {
+ progname = "<unknown>";
+ }
+
len = snprintf(client_name,
sizeof(client_name),
"%s",
-
getprogname()
);
+
progname
);
if (len <= 0) {
- return
"<unkonwn>"
;
+ return
progname
;
}
}