diff --git a/e2fsck/logfile.c b/e2fsck/logfile.c index c48b8eb8..e004f31a 100644 --- a/e2fsck/logfile.c +++ b/e2fsck/logfile.c @@ -20,6 +20,8 @@ #include "e2fsck.h" #include +extern e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */ + struct string { char *s; int len; @@ -233,6 +235,8 @@ static FILE *save_output(const char *s0, const char *s1, const char *s2) } if (pid == 0) { + if (e2fsck_global_ctx && e2fsck_global_ctx->progress_fd) + close(e2fsck_global_ctx->progress_fd); if (daemon(0, 0) < 0) { perror("daemon"); exit(1); diff --git a/lib/ext2fs/symlink.c b/lib/ext2fs/symlink.c index 0732afe4..279f48b4 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/resize/resize2fs.c b/resize/resize2fs.c index 3fa13cfc..2febfde3 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,