summaryrefslogtreecommitdiff
path: root/scheduler/ipp.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-08-27 16:43:16 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-08-27 16:43:16 -0400
commit59a8560a52b4a6c8d8bd79c6d3456be040c3f42e (patch)
tree32b55a707d086891afa0bde5335d746933deccfc /scheduler/ipp.c
parentbac967ae5656cd6e3fc38977fb5e1222782bf7d4 (diff)
downloadcups-59a8560a52b4a6c8d8bd79c6d3456be040c3f42e.tar.gz
Fix a scheduler crash bug (rdar://42198057)
Diffstat (limited to 'scheduler/ipp.c')
-rw-r--r--scheduler/ipp.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 1fe068f11..b472112ee 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -4813,10 +4813,10 @@ copy_job_attrs(cupsd_client_t *con, /* I - Client connection */
ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", job->koctets);
if (job->name && (!ra || cupsArrayFind(ra, "job-name")))
- ippAddString(con->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_NAME), "job-name", NULL, job->name);
+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, job->name);
if (job->username && (!ra || cupsArrayFind(ra, "job-originating-user-name")))
- ippAddString(con->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_NAME), "job-originating-user-name", NULL, job->username);
+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-user-name", NULL, job->username);
if (!ra || cupsArrayFind(ra, "job-state"))
ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", (int)job->state_value);
@@ -4942,9 +4942,9 @@ copy_printer_attrs(
};
if (printer->type & CUPS_PRINTER_CLASS)
- ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY, "printer-error-policy-supported", NULL, "retry-current-job");
+ ippAddString(con->response, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_NAME), "printer-error-policy-supported", NULL, "retry-current-job");
else
- ippAddStrings(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY, "printer-error-policy-supported", sizeof(errors) / sizeof(errors[0]), NULL, errors);
+ ippAddStrings(con->response, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_NAME), "printer-error-policy-supported", sizeof(errors) / sizeof(errors[0]), NULL, errors);
}
if (!ra || cupsArrayFind(ra, "printer-icons"))
@@ -5079,9 +5079,7 @@ copy_subscription_attrs(
* Simple event list...
*/
- ippAddString(con->response, IPP_TAG_SUBSCRIPTION,
- (ipp_tag_t)(IPP_TAG_KEYWORD | IPP_TAG_COPY),
- "notify-events", NULL, name);
+ ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_CONST_TAG(IPP_TAG_KEYWORD), "notify-events", NULL, name);
}
else
{
@@ -5093,15 +5091,12 @@ copy_subscription_attrs(
if (sub->mask & mask)
count ++;
- attr = ippAddStrings(con->response, IPP_TAG_SUBSCRIPTION,
- (ipp_tag_t)(IPP_TAG_KEYWORD | IPP_TAG_COPY),
- "notify-events", count, NULL, NULL);
+ attr = ippAddStrings(con->response, IPP_TAG_SUBSCRIPTION, IPP_CONST_TAG(IPP_TAG_KEYWORD), "notify-events", count, NULL, NULL);
for (mask = 1, count = 0; mask < CUPSD_EVENT_ALL; mask <<= 1)
if (sub->mask & mask)
{
- attr->values[count].string.text =
- (char *)cupsdEventName((cupsd_eventmask_t)mask);
+ attr->values[count].string.text = (char *)cupsdEventName((cupsd_eventmask_t)mask);
count ++;
}