cups/0001-backend-scheduler-ipp.c-Fix-printer-alert-invalid-fr.patch

44 lines
1.6 KiB
Diff
Raw Normal View History

From 5313c22785446473771e07d5adb1d2f11cbcbfe7 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Mon, 9 Nov 2020 07:40:20 +0100
Subject: [PATCH] backend,scheduler/ipp.c: Fix 'printer-alert' invalid free
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The fix is created by Bernhard Übelacker from apple/cups #5826.
---
backend/ipp.c | 2 +-
scheduler/ipp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/ipp.c b/backend/ipp.c
index 35c0711c0..3e601b2ad 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 0c44d7d4a..68763a0f1 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);
--
2.26.2