diff --git a/debian/changelog b/debian/changelog index 581b500..04260f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +genext2fs (1.4.1-4) UNRELEASED; urgency=low + + * debian/patches/byteswap_fix.diff: New patch by Samuel Thibault, + fix a segfault in the byte swapping code on little-endian architectures + (closes: 644776). + + -- Jérémie Koenig Tue, 29 Nov 2011 17:18:12 +0100 + genext2fs (1.4.1-3) unstable; urgency=low * New maintainer (closes: 579369). diff --git a/debian/patches/byteswap_fix.diff b/debian/patches/byteswap_fix.diff new file mode 100644 index 0000000..7b3c00b --- /dev/null +++ b/debian/patches/byteswap_fix.diff @@ -0,0 +1,44 @@ +Index: genext2fs/genext2fs.c +=================================================================== +--- genext2fs.orig/genext2fs.c 2011-11-29 17:36:06.000000000 +0100 ++++ genext2fs/genext2fs.c 2011-11-29 17:37:37.000000000 +0100 +@@ -1779,7 +1779,8 @@ + assert(nod->i_block[EXT2_DIND_BLOCK] != 0); + for(i = 0; i < BLOCKSIZE/4; i++) + if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) +- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); ++ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]) ++ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); + swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); + if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) + return; +@@ -1792,7 +1793,8 @@ + (BLOCKSIZE/4)*(BLOCKSIZE/4) + + i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + + j*(BLOCKSIZE/4)) ) +- swap_block(get_blk(fs,b2[j])); ++ if (b2[j]) ++ swap_block(get_blk(fs,b2[j])); + else { + done = 1; + break; +@@ -1825,7 +1827,8 @@ + swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); + for(i = 0; i < BLOCKSIZE/4; i++) + if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) +- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); ++ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]) ++ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); + if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) + return; + /* Adding support for triple indirection */ +@@ -1839,7 +1842,8 @@ + (BLOCKSIZE/4)*(BLOCKSIZE/4) + + i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + + j*(BLOCKSIZE/4)) ) +- swap_block(get_blk(fs,b2[j])); ++ if (b2[j]) ++ swap_block(get_blk(fs,b2[j])); + else { + done = 1; + break; diff --git a/debian/patches/series b/debian/patches/series index 4dd8d0a..2883ba0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ c99_scanf.diff autoconf.diff blocksize+creator.diff +byteswap_fix.diff