lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141220211647.25563.61104.stgit@birch.djwong.org>
Date:	Sat, 20 Dec 2014 13:16:47 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	tytso@....edu, darrick.wong@...cle.com
Cc:	linux-ext4@...r.kernel.org
Subject: [PATCH 01/31] misc: fix clang warnings and a resource leak

Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
 lib/ext2fs/symlink.c |    2 +-
 misc/e2fuzz.c        |    2 +-
 resize/resize2fs.c   |    6 ++++--
 3 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/lib/ext2fs/symlink.c b/lib/ext2fs/symlink.c
index 0732afe..279f48b 100644
--- a/lib/ext2fs/symlink.c
+++ b/lib/ext2fs/symlink.c
@@ -112,7 +112,7 @@ need_block:
 		ext2fs_iblk_set(fs, &inode, 1);
 		/* Slow symlinks, target stored in the first block */
 		memset(block_buf, 0, fs->blocksize);
-		strcpy(block_buf, target);
+		strncpy(block_buf, target, fs->blocksize);
 		if (fs->super->s_feature_incompat &
 		    EXT3_FEATURE_INCOMPAT_EXTENTS) {
 			/*
diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c
index c08e3df..f786eac 100644
--- a/misc/e2fuzz.c
+++ b/misc/e2fuzz.c
@@ -273,7 +273,7 @@ int process_fs(const char *fsname)
 		if ((rand() % 2) && c < 128)
 			c |= 0x80;
 		if (verbose)
-			printf("Corrupting byte %jd in block %jd to 0x%x\n",
+			printf("Corrupting byte %zu in block %zu to 0x%x\n",
 			       off % fs->blocksize, off / fs->blocksize, c);
 		if (dryrun)
 			continue;
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 3fa13cf..2febfde 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -2311,8 +2311,10 @@ static errcode_t move_itables(ext2_resize_t rfs)
 		    ext2fs_inode_table_loc(fs, i))
 			to_move++;
 
-	if (to_move == 0)
-		return 0;
+	if (to_move == 0) {
+		retval = 0;
+		goto errout;
+	}
 
 	if (rfs->progress) {
 		retval = rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ