Blame SOURCES/pnm2ppa-coverity-return-local.patch

a90dc3
diff -up pnm2ppa-1.04/calibrate_ppa.c.coverity-return-local pnm2ppa-1.04/calibrate_ppa.c
a90dc3
--- pnm2ppa-1.04/calibrate_ppa.c.coverity-return-local	2000-11-11 22:22:38.000000000 +0000
a90dc3
+++ pnm2ppa-1.04/calibrate_ppa.c	2011-05-20 16:04:23.233425268 +0100
a90dc3
@@ -75,7 +75,7 @@ main (int argc, char *argv[])
a90dc3
   BOOLEAN gamma = false ;
a90dc3
   FILE *outFile = NULL ;
a90dc3
   int testPattern = 0;
a90dc3
-  char *out_filepath = NULL;
a90dc3
+  char out_filepath[MAXPATHLEN];
a90dc3
   char c;
a90dc3
   static struct option long_opts[] = {
a90dc3
     {"gamma",0,0,'g'},
a90dc3
@@ -157,9 +157,7 @@ main (int argc, char *argv[])
a90dc3
 	    {
a90dc3
 	      if ( strlen(optarg) < MAXPATHLEN )
a90dc3
 		{
a90dc3
-                  char filepath[MAXPATHLEN];
a90dc3
-		  strncpy(filepath, optarg, MAXPATHLEN);
a90dc3
-		  out_filepath = filepath ;
a90dc3
+		  strncpy(out_filepath, optarg, MAXPATHLEN);
a90dc3
 		  use_stdout = false ;
a90dc3
 		}
a90dc3
 	    }
a90dc3
diff -up pnm2ppa-1.04/pnm2ppa.c.coverity-return-local pnm2ppa-1.04/pnm2ppa.c
a90dc3
--- pnm2ppa-1.04/pnm2ppa.c.coverity-return-local	2000-11-11 19:53:03.000000000 +0000
a90dc3
+++ pnm2ppa-1.04/pnm2ppa.c	2011-05-20 16:04:23.234425246 +0100
a90dc3
@@ -145,20 +145,15 @@ print_pnm (FILE * fptr)
a90dc3
 char *
a90dc3
 readPath(char *input )
a90dc3
 { 	 
a90dc3
-  char File_path[MAXPATHLEN];
a90dc3
   char *path = NULL;
a90dc3
   /* security audit ajv 20001007;  be very careful with input strings!*/
a90dc3
   if (strlen(input) < MAXPATHLEN )
a90dc3
     {
a90dc3
-      if ( strncpy (File_path, input, MAXPATHLEN ))
a90dc3
-	{
a90dc3
-	  /*
a90dc3
-	    a user-specifed file *File_path may later be opened;
a90dc3
-	    should any extra validation of this be performed now ?
a90dc3
-	  */
a90dc3
-	  path = File_path;
a90dc3
-	  return path;
a90dc3
-	}
a90dc3
+      path = strdup(input);
a90dc3
+      /*
a90dc3
+        a user-specifed file *path may later be opened;
a90dc3
+        should any extra validation of this be performed now ?
a90dc3
+       */
a90dc3
     }
a90dc3
   else
a90dc3
     {