fix crash in scheduler (#1253135)
This commit is contained in:
parent
6a53bfe80e
commit
c24d1eaaa9
@ -1,25 +1,30 @@
|
|||||||
From d6474c395e14b3079dd198fadf7427c67412e816 Mon Sep 17 00:00:00 2001
|
diff -up cups-2.1rc1/scheduler/log.c.journal cups-2.1rc1/scheduler/log.c
|
||||||
From: Jiri Popelka <jpopelka@redhat.com>
|
--- cups-2.1rc1/scheduler/log.c.journal 2015-08-13 11:12:07.738534615 +0200
|
||||||
Date: Mon, 10 Aug 2015 17:12:32 +0200
|
+++ cups-2.1rc1/scheduler/log.c 2015-08-13 11:14:41.411980473 +0200
|
||||||
Subject: [PATCH] Fix index out of range in cupsdLogJob()
|
@@ -646,7 +646,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo
|
||||||
|
|
||||||
---
|
asl_set(m, PWG_Event, "JobStateChanged");
|
||||||
scheduler/log.c | 2 +-
|
asl_set(m, PWG_JobID, job_id);
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
- asl_set(m, PWG_JobState, job_states[job->state_value - IPP_JSTATE_PENDING]);
|
||||||
|
+ asl_set(m, PWG_JobState, job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING]);
|
||||||
|
|
||||||
diff --git a/scheduler/log.c b/scheduler/log.c
|
if (job->impressions)
|
||||||
index cef0219..21489d5 100644
|
{
|
||||||
--- a/scheduler/log.c
|
@@ -666,7 +666,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo
|
||||||
+++ b/scheduler/log.c
|
#elif defined(HAVE_SYSTEMD_SD_JOURNAL_H)
|
||||||
@@ -667,7 +667,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */
|
if (!strcmp(ErrorLog, "syslog"))
|
||||||
|
{
|
||||||
|
- cupsd_printer_t *printer = job->printer ? job->printer : job->dest ? cupsdFindDest(job->dest) : NULL;
|
||||||
|
+ cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL;
|
||||||
|
static const char * const job_states[] =
|
||||||
|
{ /* job-state strings */
|
||||||
|
"Pending",
|
||||||
|
@@ -696,7 +696,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo
|
||||||
PWG_Event"=JobStateChanged",
|
PWG_Event"=JobStateChanged",
|
||||||
PWG_ServiceURI"=%s", printer ? printer->uri : "",
|
PWG_ServiceURI"=%s", printer ? printer->uri : "",
|
||||||
PWG_JobID"=%d", job->id,
|
PWG_JobID"=%d", job->id,
|
||||||
- PWG_JobState"=%s", job_states[job->state_value - IPP_JSTATE_PENDING],
|
- PWG_JobState"=%s", job_states[job->state_value - IPP_JSTATE_PENDING],
|
||||||
+ PWG_JobState"=%s", job->state_value >= IPP_JSTATE_PENDING ? job_states[job->state_value - IPP_JSTATE_PENDING] : "",
|
+ PWG_JobState"=%s", job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING],
|
||||||
PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0),
|
PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0),
|
||||||
NULL);
|
NULL);
|
||||||
else
|
else
|
||||||
--
|
|
||||||
2.5.0
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ Summary: CUPS printing system
|
|||||||
Name: cups
|
Name: cups
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 2.1
|
Version: 2.1
|
||||||
Release: 0.2%{prever}%{?dist}
|
Release: 0.3%{prever}%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Url: http://www.cups.org/
|
Url: http://www.cups.org/
|
||||||
Source0: http://www.cups.org/software/%{VERSION}/cups-%{VERSION}-source.tar.bz2
|
Source0: http://www.cups.org/software/%{VERSION}/cups-%{VERSION}-source.tar.bz2
|
||||||
@ -621,6 +621,9 @@ rm -f %{cups_serverbin}/backend/smb
|
|||||||
%{_mandir}/man5/ipptoolfile.5.gz
|
%{_mandir}/man5/ipptoolfile.5.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Aug 13 2015 Jiri Popelka <jpopelka@redhat.com> - 1:2.1-0.3rc1
|
||||||
|
- fix crash in scheduler (#1253135)
|
||||||
|
|
||||||
* Mon Aug 10 2015 Jiri Popelka <jpopelka@redhat.com> - 1:2.1-0.2rc1
|
* Mon Aug 10 2015 Jiri Popelka <jpopelka@redhat.com> - 1:2.1-0.2rc1
|
||||||
- better fix for STR#4687
|
- better fix for STR#4687
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user