From: AlaskanEmily Date: Mon, 25 Oct 2021 22:14:44 +0000 (-0700) Subject: Avoid a crash when an Avahi or mDNS printer has neither device-uri nor printer-uri... X-Git-Tag: v2.4b1~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F279%2Fhead;p=thirdparty%2Fcups.git Avoid a crash when an Avahi or mDNS printer has neither device-uri nor printer-uri-supported set. --- diff --git a/cups/dest.c b/cups/dest.c index fa6202c772..2ca2246d54 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1142,7 +1142,7 @@ _cupsGetDestResource( DEBUG_printf(("1_cupsGetDestResource: device-uri=\"%s\", printer-uri-supported=\"%s\".", device_uri, printer_uri)); #ifdef HAVE_DNSSD - if (((flags & CUPS_DEST_FLAGS_DEVICE) || !printer_uri) && strstr(device_uri, "._tcp")) + if (((flags & CUPS_DEST_FLAGS_DEVICE) || !printer_uri) && device_uri && strstr(device_uri, "._tcp")) { if ((device_uri = cups_dnssd_resolve(dest, device_uri, 5000, NULL, NULL, NULL)) != NULL) {