[Lsb-messages] /var/www/bzr/lsb/devel/misc-test r2441: squish two more coverity complaints

Mats Wichmann mats at linuxfoundation.org
Tue Mar 31 22:22:17 UTC 2015


------------------------------------------------------------
revno: 2441
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: misc-test
timestamp: Tue 2015-03-31 16:22:17 -0600
message:
  squish two more coverity complaints
modified:
  fhschk/mkabs.c
  package/Makefile
  rpmchk/archive.c
-------------- next part --------------
=== modified file 'fhschk/mkabs.c'
--- a/fhschk/mkabs.c	2015-03-29 18:07:37 +0000
+++ b/fhschk/mkabs.c	2015-03-31 22:22:17 +0000
@@ -35,12 +35,12 @@
 	char joinedpath[PATH_MAX + 1];
 
 	strncpy(joinedpath, cwd, PATH_MAX);
-	strncat(joinedpath, "/", PATH_MAX);
+	strcat(joinedpath, "/");
 	strncat(joinedpath, path, PATH_MAX - strlen(joinedpath));
 	strcpy(localpath, joinedpath);
     } else {
 	/* An absolute path */
-	strcpy(localpath, path);
+	strncpy(localpath, path, PATH_MAX);
     }
 
     /* 

=== modified file 'package/Makefile'
--- a/package/Makefile	2015-03-29 18:07:37 +0000
+++ b/package/Makefile	2015-03-31 22:22:17 +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
-BUILDNO=5
+BUILDNO=6
 
 # 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:48:03 +0000
+++ b/rpmchk/archive.c	2015-03-31 22:22:17 +0000
@@ -64,9 +64,9 @@
 
     if (hasCompressedFileNames) {
 	if (hasNewFilenames) {
-	    strcpy(tmpfilename, filename);
+	    strncpy(tmpfilename, filename, PATH_MAX);
 	    fname = basename(tmpfilename);
-	    *fname = '\000';
+	    *fname = '\0';
 
 	    for (i = 0; i < numdirnames; i++) {
 		sprintf(tagfilename, fmt, dirnames[i]);
@@ -76,8 +76,10 @@
 	    if (i == numdirnames)
 		fprintf(stderr, " no dir found!!!\n");
 
+	    /* this seems like a repeat of above, nothing has changed 
 	    strcpy(tmpfilename, filename);
 	    fname = basename(tmpfilename);
+	    */
 
 	    for (j = 0; j < numdirindicies; j++) {
 		if (dirindicies[j] == i) {



More information about the lsb-messages mailing list