diff --git a/lib/ext2fs/symlink.c b/lib/ext2fs/symlink.c index ba8ed8ef..7c485a5f 100644 --- a/lib/ext2fs/symlink.c +++ b/lib/ext2fs/symlink.c @@ -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) { /* diff --git a/resize/resize2fs.c b/resize/resize2fs.c index b3755f62..a2806b11 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -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,