From 1df5c692513d8067e0892398e1301b7eb8bba2a1 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Fri, 17 Aug 2001 09:55:09 +0000 Subject: [PATCH] Fixed a overflow problem in dump (LFS) --- CHANGES | 6 +++++- dump/traverse.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index dccc4ed..dba3572 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.134 2001/08/16 15:24:21 stelian Exp $ +$Id: CHANGES,v 1.135 2001/08/17 09:55:09 stelian Exp $ Changes between versions 0.4b23 and 0.4b24 (released ?????????????) =================================================================== @@ -27,6 +27,10 @@ Changes between versions 0.4b23 and 0.4b24 (released ?????????????) the tape format of a bzip2 dump is not compatible with the original BSD tape format. +7. Fixed a overflow problem in dump corrupting the dump when + very large files were encountered. Thanks to Vladimir Nadvornik + for the bug report. + Changes between versions 0.4b22 and 0.4b23 (released July 20, 2001) =================================================================== diff --git a/dump/traverse.c b/dump/traverse.c index a8ca3a4..975f6f8 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.37 2001/07/19 09:49:35 stelian Exp $"; + "$Id: traverse.c,v 1.38 2001/08/17 09:55:09 stelian Exp $"; #endif /* not lint */ #include @@ -898,8 +898,8 @@ dumpino(struct dinode *dp, dump_ino_t ino) ext2fs_block_iterate2(fs, (ext2_ino_t)ino, 0, NULL, dumponeblock, (void *)&bc); /* deal with holes at the end of the inode */ - if (i_size > bc.next_block*sblock->fs_fsize) { - remaining = i_size - bc.next_block*sblock->fs_fsize; + if (i_size > ((u_quad_t)bc.next_block) * sblock->fs_fsize) { + remaining = i_size - ((u_quad_t)bc.next_block) * sblock->fs_fsize; for (i = 0; i < howmany(remaining, sblock->fs_fsize); i++) { bc.buf[bc.cnt++] = 0; if (bc.cnt == bc.max) { -- 2.39.5