Fix clang warning and a resource leak

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
test-maint
Darrick J. Wong 2015-01-19 16:31:49 -05:00 committed by Theodore Ts'o
parent a4f95ccad4
commit c916e5248b
2 changed files with 5 additions and 3 deletions

View File

@ -88,7 +88,7 @@ errcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,
} else {
/* 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) {
/*

View File

@ -1852,8 +1852,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,