rpms/cups/devel cups-str3407.patch,NONE,1.1 cups.spec,1.540,1.541

Tim Waugh twaugh at fedoraproject.org
Tue Nov 17 13:14:28 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/cups/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6835

Modified Files:
	cups.spec 
Added Files:
	cups-str3407.patch 
Log Message:
* Tue Nov 17 2009 Tim Waugh <twaugh at redhat.com> 1:1.4.2-6
- Fixed out-of-memory handling when loading jobs (bug #538054,
  STR #3407).


cups-str3407.patch:
 job.c |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

--- NEW FILE cups-str3407.patch ---
diff -up cups-1.4.2/CHANGES-1.4.txt.str3407 cups-1.4.2/CHANGES-1.4.txt
diff -up cups-1.4.2/scheduler/job.c.str3407 cups-1.4.2/scheduler/job.c
--- cups-1.4.2/scheduler/job.c.str3407	2009-11-17 12:18:38.518084476 +0000
+++ cups-1.4.2/scheduler/job.c	2009-11-17 13:00:46.204083691 +0000
@@ -1721,7 +1721,30 @@ cupsdLoadJob(cupsd_job_t *job)		/* I - J
           cupsdLogMessage(CUPSD_LOG_ERROR,
 	                  "[Job %d] Ran out of memory for job file types!",
 			  job->id);
-	  return (1);
+
+	  ippDelete(job->attrs);
+	  job->attrs = NULL;
+
+	  if (compressions)
+	    free(compressions);
+
+	  if (filetypes)
+	    free(filetypes);
+
+	  if (job->compressions)
+	  {
+	    free(job->compressions);
+	    job->compressions = NULL;
+	  }
+
+	  if (job->filetypes)
+	  {
+	    free(job->filetypes);
+	    job->filetypes = NULL;
+	  }
+
+	  job->num_files = 0;
+	  return (0);
 	}
 
         job->compressions = compressions;
@@ -1789,6 +1812,21 @@ cupsdLoadJob(cupsd_job_t *job)		/* I - J
 
   ippDelete(job->attrs);
   job->attrs = NULL;
+
+  if (job->compressions)
+  {
+    free(job->compressions);
+    job->compressions = NULL;
+  }
+
+  if (job->filetypes)
+  {
+    free(job->filetypes);
+    job->filetypes = NULL;
+  }
+
+  job->num_files = 0;
+
   unlink(jobfile);
 
   return (0);
@@ -4411,7 +4449,7 @@ update_job_attrs(cupsd_job_t *job,	/* I 
   else if (job->printer->state_message[0] && do_message)
     cupsdSetString(&(job->printer_message->values[0].string.text),
 		   job->printer->state_message);
-  
+
  /*
   * ... and the printer-state-reasons value...
   */


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.540
retrieving revision 1.541
diff -u -p -r1.540 -r1.541
--- cups.spec	16 Nov 2009 17:23:13 -0000	1.540
+++ cups.spec	17 Nov 2009 13:14:28 -0000	1.541
@@ -9,7 +9,7 @@
 Summary: Common Unix Printing System
 Name: cups
 Version: 1.4.2
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -55,6 +55,7 @@ Patch29: cups-str3391.patch
 Patch30: cups-str3381.patch
 Patch31: cups-str3399.patch
 Patch32: cups-str3403.patch
+Patch33: cups-str3407.patch
 
 Patch100: cups-lspp.patch
 
@@ -220,6 +221,7 @@ module. 
 %patch30 -p1 -b .str3381
 %patch31 -p1 -b .str3399
 %patch32 -p1 -b .str3403
+%patch33 -p1 -b .str3407
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -512,6 +514,10 @@ rm -rf $RPM_BUILD_ROOT
 %{php_extdir}/phpcups.so
 
 %changelog
+* Tue Nov 17 2009 Tim Waugh <twaugh at redhat.com> 1:1.4.2-6
+- Fixed out-of-memory handling when loading jobs (bug #538054,
+  STR #3407).
+
 * Mon Nov 16 2009 Tim Waugh <twaugh at redhat.com> 1:1.4.2-5
 - Fixed typo in admin web template (bug #537884, STR #3403).
 - Reset SIGPIPE handler for child processes (bug #537886, STR #3399).




More information about the scm-commits mailing list