From: Michael R Sweet Date: Mon, 29 Jun 2026 17:06:12 +0000 (-0400) Subject: Make sure we don't report invalid printer-state-reasons or printer-mandatory-job... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d3fb86dfc7d2b854d33864480ac5922b7172c4d;p=thirdparty%2Fcups.git Make sure we don't report invalid printer-state-reasons or printer-mandatory-job-attributes strings (Issue #1632) --- diff --git a/backend/ipp.c b/backend/ipp.c index b96d949bd4..a4afc50d31 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -3220,7 +3220,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */ IPP_TAG_TEXT)) != NULL) report_attr(pam); - if ((pmja = ippFindAttribute(ipp, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL) + if ((pmja = ippFindAttribute(ipp, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL && ippValidateAttribute(pmja)) { int i, /* Looping var */ count = ippGetCount(pmja); /* Number of values */ @@ -3240,8 +3240,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */ } } - if ((psm = ippFindAttribute(ipp, "printer-state-message", - IPP_TAG_TEXT)) != NULL) + if ((psm = ippFindAttribute(ipp, "printer-state-message", IPP_TAG_TEXT)) != NULL && ippValidateAttribute(psm)) { char *ptr; /* Pointer into message */ @@ -3275,11 +3274,8 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */ * want to set... */ - if ((reasons = ippFindAttribute(ipp, "printer-state-reasons", - IPP_TAG_KEYWORD)) == NULL) - return; - - update_reasons(reasons, NULL); + if ((reasons = ippFindAttribute(ipp, "printer-state-reasons", IPP_TAG_KEYWORD)) != NULL && ippValidateAttribute(reasons)) + update_reasons(reasons, NULL); /* * Relay the current marker-* attribute values...