rpms/system-config-printer/devel pycups-uninit.patch, NONE, 1.1 system-config-printer.spec, 1.143, 1.144

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Wed Nov 21 12:41:17 UTC 2007


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27044

Modified Files:
	system-config-printer.spec 
Added Files:
	pycups-uninit.patch 
Log Message:
* Wed Nov 21 2007 Tim Waugh <twaugh at redhat.com>
- Applied patch to pycups to avoid reading uninitialised
  memory (bug #390431).


pycups-uninit.patch:

--- NEW FILE pycups-uninit.patch ---
diff -up pycups-1.9.30/cupsconnection.c.uninit pycups-1.9.30/cupsconnection.c
--- pycups-1.9.30/cupsconnection.c.uninit	2007-11-19 16:41:14.000000000 +0000
+++ pycups-1.9.30/cupsconnection.c	2007-11-21 11:18:20.000000000 +0000
@@ -2334,7 +2334,7 @@ Connection_printTestPage (Connection *se
     return NULL;
   }
     
-  if (!file) {
+  if (!fileobj) {
     if ((datadir = getenv ("CUPS_DATADIR")) == NULL)
       datadir = "/usr/share/cups";
 
@@ -2342,13 +2342,13 @@ Connection_printTestPage (Connection *se
     file = filename;
   }
 
-  if (!title)
+  if (!titleobj)
     title = "Test Page";
 
-  if (!format)
+  if (!formatobj)
     format = "application/postscript";
 
-  if (!user)
+  if (!userobj)
     user = "guest";
 
   snprintf (uri, sizeof (uri), "ipp://localhost/printers/%s", printer);
diff -U0 pycups-1.9.30/ChangeLog.uninit pycups-1.9.30/ChangeLog
--- pycups-1.9.30/ChangeLog.uninit	2007-11-19 16:41:14.000000000 +0000
+++ pycups-1.9.30/ChangeLog	2007-11-21 11:18:20.000000000 +0000
@@ -0,0 +1,7 @@
+2007-11-21  Tim Waugh  <twaugh at redhat.com>
+
+	* cupsmodule.c (cups_require): Don't read uninitialised memory.
+
+	* cupsconnection.c (Connection_printTestPage): Don't use
+	uninitialised variables (bug #390431).
+
diff -up pycups-1.9.30/cupsmodule.c.uninit pycups-1.9.30/cupsmodule.c
--- pycups-1.9.30/cupsmodule.c.uninit	2007-09-12 14:12:11.000000000 +0100
+++ pycups-1.9.30/cupsmodule.c	2007-11-21 11:18:20.000000000 +0000
@@ -253,13 +253,18 @@ cups_require (PyObject *self, PyObject *
   nreq = strtoul (preq, &end, 0);
   while (preq != end)
   {
-    preq = end + 1;
+    preq = end;
+    if (*preq == '.')
+      preq++;
 
     nver = strtoul (pver, &end, 0);
     if (pver == end)
       goto fail;
-    else
-      pver = end + 1;
+    else {
+      pver = end;
+      if (*pver == '.')
+	pver++;
+    }
 
     if (nver < nreq)
       goto fail;


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- system-config-printer.spec	19 Nov 2007 17:22:10 -0000	1.143
+++ system-config-printer.spec	21 Nov 2007 12:40:45 -0000	1.144
@@ -11,6 +11,7 @@
 Source1: pycups-%{pycups_version}.tar.bz2
 Source2: system-config-printer.pam
 Source3: system-config-printer.console
+Patch0: pycups-uninit.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -52,6 +53,9 @@
 
 %prep
 %setup -q -a 1
+pushd pycups-%{pycups_version}
+%patch0 -p1 -b .uninit
+popd
 
 %build
 %configure
@@ -122,6 +126,10 @@
 exit 0
 
 %changelog
+* Wed Nov 21 2007 Tim Waugh <twaugh at redhat.com>
+- Applied patch to pycups to avoid reading uninitialised
+  memory (bug #390431).
+
 * Mon Nov 19 2007 Tim Waugh <twaugh at redhat.com>
 - Updated pycups to 1.9.30.
 




More information about the fedora-extras-commits mailing list