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

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