Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > a6d834a9c140b265683df6c3e6bd34bb > files > 16

hplip-3.10.6-3.fc14.src.rpm

diff -up hplip-3.10.2/prnt/cupsext/cupsext.c.openPPD hplip-3.10.2/prnt/cupsext/cupsext.c
--- hplip-3.10.2/prnt/cupsext/cupsext.c.openPPD	2010-02-25 00:04:58.000000000 +0100
+++ hplip-3.10.2/prnt/cupsext/cupsext.c	2010-03-17 19:54:19.000000000 +0100
@@ -1221,9 +1221,18 @@ PyObject * openPPD( PyObject * self, PyO
         return Py_BuildValue( "" ); // None
     }
 
-    g_ppd_file = cupsGetPPD( ( const char * ) printer );
+    if ( ( g_ppd_file = cupsGetPPD( ( const char * ) printer ) ) == NULL )
+    {
+        goto bailout;
+    }
+
+    if ( ( file = fopen( g_ppd_file, "r" )) == NULL )
+    {
+        unlink(g_ppd_file);
+        g_ppd_file = NULL;
+        goto bailout;
+    }
 
-    file = fopen( g_ppd_file, "r" );
     ppd = ppdOpen( file );
     ppdLocalize( ppd );
     fclose( file );