From: Zdenek Dohnal Date: Mon, 9 Nov 2020 06:40:20 +0000 (+0100) Subject: backend,scheduler/ipp.c: Fix 'printer-alert' invalid free X-Git-Tag: v2.3.3op1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F43%2Fhead;p=thirdparty%2Fcups.git backend,scheduler/ipp.c: Fix 'printer-alert' invalid free The fix is created by Bernhard Übelacker from apple/cups #5826. --- diff --git a/backend/ipp.c b/backend/ipp.c index 35c0711c06..3e601b2ade 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -3075,7 +3075,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */ * Report alerts and messages... */ - if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_TEXT)) != NULL) + if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_STRING)) != NULL) report_attr(pa); if ((pam = ippFindAttribute(ipp, "printer-alert-message", diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 0c44d7d4ad..68763a0f12 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -4891,7 +4891,7 @@ copy_printer_attrs( } if (printer->alert && (!ra || cupsArrayFind(ra, "printer-alert"))) - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_STRING, "printer-alert", NULL, printer->alert); + ippAddOctetString(con->response, IPP_TAG_PRINTER, "printer-alert", printer->alert, (int)strlen(printer->alert)); if (printer->alert_description && (!ra || cupsArrayFind(ra, "printer-alert-description"))) ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-alert-description", NULL, printer->alert_description);