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

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