]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix crash when host is NULL.
authorMichael R Sweet <msweet@msweet.org>
Wed, 10 Apr 2024 20:26:38 +0000 (16:26 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 10 Apr 2024 20:26:38 +0000 (16:26 -0400)
cups/dnssd.c

index 58c50fc056c0b9545e173e3c9e5f7f4f7b52a13d..c097f83786fe293d59cbd047cd0b3058c1c81d74 100644 (file)
@@ -1082,7 +1082,7 @@ cupsDNSSDServiceAdd(
 
   // Avahi has trouble with hostnames for services that are only available on
   // the loopback interface/localhost...
-  if (service->if_index == CUPS_DNSSD_IF_INDEX_LOCAL || !_cups_strcasecmp(host, "localhost"))
+  if (service->if_index == CUPS_DNSSD_IF_INDEX_LOCAL || (host && !_cups_strcasecmp(host, "localhost")))
     host = NULL;
 
   // Build the string list from the TXT array...