From: Michael R Sweet Date: Mon, 17 Nov 2025 16:31:22 +0000 (-0500) Subject: Check for NULL attr pointer. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffbb0de3d0f081bfdc6a22b44ee9253a90d62fd4;p=thirdparty%2Fcups.git Check for NULL attr pointer. --- diff --git a/scheduler/printers.c b/scheduler/printers.c index d97d5c2c5e..31205ec2ad 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3557,7 +3557,12 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ cupsdLogPrinter(p, CUPSD_LOG_DEBUG2, "add_printer_formats: %d supported types", cupsArrayCount(p->filetypes) + 1); - attr = ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE, "document-format-supported", cupsArrayCount(p->filetypes) + 1, NULL, NULL); + if ((attr = ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE, "document-format-supported", cupsArrayCount(p->filetypes) + 1, NULL, NULL)) == NULL) + { + cupsdLogPrinter(p, CUPSD_LOG_ERROR, "Unable to create document-format-supported attribute."); + return; + } + attr->values[0].string.text = _cupsStrAlloc("application/octet-stream"); cupsdLogPrinter(p, CUPSD_LOG_DEBUG2, "add_printer_formats: document-format-supported[0]='application/octet-stream'");