git.samba.org
/
lorikeet-heimdal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2122f78
)
hdb: Avoid passing a NULL pointer to strcmp()
author
Jo Sutton
<josutton@catalyst.net.nz>
Thu, 21 Sep 2023 22:54:42 +0000
(10:54 +1200)
committer
Jo Sutton
<josutton@catalyst.net.nz>
Mon, 26 Feb 2024 22:17:22 +0000
(11:17 +1300)
To do so is to invoke undefined behaviour.
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
lib/hdb/common.c
patch
|
blob
|
history
diff --git
a/lib/hdb/common.c
b/lib/hdb/common.c
index e2d12823dab8449ca39b4e078110d6e7cce6d9bd..3b8c7c5f7b694797d63fa17011e5a3430beb9a6c 100644
(file)
--- a/
lib/hdb/common.c
+++ b/
lib/hdb/common.c
@@
-1616,7
+1616,7
@@
fetch_it(krb5_context context,
if (!db->enable_virtual_hostbased_princs)
maxdots = mindots = 0;
if (db->enable_virtual_hostbased_princs && comp1 &&
-
strcmp("krbtgt", comp0) != 0 && strcmp(KRB5_WELLKNOWN_NAME, comp0) != 0
) {
+
(comp0 == NULL || (strcmp("krbtgt", comp0) != 0 && strcmp(KRB5_WELLKNOWN_NAME, comp0) != 0))
) {
char *htmp;
if ((host = strdup(comp1)) == NULL)