[Lsb-messages] /var/www/bzr/lsb/devel/misc-test r2401: revert unintended (for now) change to rpmchk/archive.c

Mats Wichmann mats at linuxfoundation.org
Tue Oct 1 17:23:26 UTC 2013


------------------------------------------------------------
revno: 2401
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: misc-test
timestamp: Tue 2013-10-01 11:23:26 -0600
message:
  revert unintended (for now) change to rpmchk/archive.c
modified:
  package/Makefile
  rpmchk/archive.c
-------------- next part --------------
=== modified file 'package/Makefile'
--- a/package/Makefile	2013-09-28 15:50:38 +0000
+++ b/package/Makefile	2013-10-01 17:23:26 +0000
@@ -24,7 +24,7 @@
 
 # We define this here instead of directly in the spec file as
 # we need to be able to work out what the produced rpm files will be called
-RPM_PACKAGE_RELEASE=4
+RPM_PACKAGE_RELEASE=5
 
 # Derive date string for daily snapshots
 ISO_DATE:=$(shell date +"%Y%m%d")

=== modified file 'rpmchk/archive.c'
--- a/rpmchk/archive.c	2013-10-01 17:11:31 +0000
+++ b/rpmchk/archive.c	2013-10-01 17:23:26 +0000
@@ -524,6 +524,7 @@
     int filesizesum = 0;
     int i;
     ElfFile *elfFile;
+    char *execFile = NULL;
 
     file1->archive = (caddr_t) file1->nexthdr;
 
@@ -617,7 +618,7 @@
 	    elfFile->size = elfFiles[i]->filesize;
 	    elfFile->filename = NULL;
 
-	    if ((elfFile->addr = (char *) calloc(1, elfFile->size)) == NULL) {
+	    if ((execFile = (char *) calloc(1, elfFile->size)) == NULL) {
 		    fprintf(stderr,
 			    "Unable to alloc memory for uncompressed file %s\n",
 			    elfFiles[i]->filename);
@@ -649,7 +650,8 @@
 		    "\ncheckRpmArchive: Inflating file %s-pass2 size %d ...\n",
 		    elfFiles[i]->filename, elfFile->size);
 #endif
-	    gzread(zfile, elfFile->addr, elfFile->size);
+	    gzread(zfile, execFile, elfFile->size);
+	    elfFile->addr = execFile;
 	    snprintf(tmp_string, TMP_STRING_SIZE,
 		     "Checking ELF file %s ...", elfFiles[i]->filename);
 	    fprintf(stderr, "%s\n", tmp_string);
@@ -664,10 +666,7 @@
 		checkElf(elfFile, ELF_IS_DSO, journal);
 		check_lib(elfFile, ELF_IS_DSO, modules);
 	    }
-
-out:	    /* before exit, free up the various allocated chunks */
-	    if(elfFIle && elfFile->addr)
-		free(elfFile->addr);
+out:
 
 	    if(elfFile && elfFile->filename)
 		free(elfFile->filename);
@@ -675,9 +674,12 @@
 	    if(elfFile && elfFile->versionnames)
 		free(elfFile->versionnames);
 
+	    if(execFile)
+		free(execFile);
 	    if(elfFile)
 		free(elfFile);
 	}			/* for number of ET_EXEC files */
     }				/* if check_app */
+    
     gzclose(zfile);
 }



More information about the lsb-messages mailing list