Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion backend/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,10 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
cupsCopyString(value, ippGetString(pmja, i, NULL), sizeof(value));
}

for (valptr = value; *valptr; valptr ++)
if ((*valptr & 255) < ' ' || *valptr == 0x7f)
*valptr = ' ';

if (strcmp(value, mandatory_attrs))
{
cupsCopyString(mandatory_attrs, value, sizeof(mandatory_attrs));
Expand Down Expand Up @@ -3578,7 +3582,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */

if (attr)
{
int i; /* Looping var */
int i; /* Looping var */
const char *rp; /* Pointer into reason keyword */

new_reasons = cupsArrayNew((cups_array_func_t)_cupsArrayStrcmp, NULL);
op = '\0';
Expand All @@ -3587,6 +3592,12 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
{
reason = attr->values[i].string.text;

for (rp = reason; *rp; rp ++)
if ((*rp & 255) < ' ' || *rp == 0x7f)
break;
if (*rp)
continue; /* Skip keyword with control chars */

if (strcmp(reason, "none") &&
strcmp(reason, "none-report") &&
strcmp(reason, "paused") &&
Expand Down
Loading