From: Theodore Ts'o Date: Sun, 12 Nov 2006 15:40:40 +0000 (-0500) Subject: Allow unix_io offsets greater than 2G X-Git-Tag: E2FSPROGS-1_40-WIP-1114~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2aee23f325037fce1db32d556e6cf9adaa97ce04;p=thirdparty%2Fe2fsprogs.git Allow unix_io offsets greater than 2G Addresses SourceForge Bug: #1547922 Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 51a2f3ae9..8e5e8c074 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,8 @@ +2006-11-12 Theodore Tso + + * unix_io.c (unix_flush): Allow offsets greater than 2G. + (Addresses SourceForge Bug #1547922) + 2006-11-11 Theodore Tso * dirhash.c (str2hashbuf, ext2fs_dirhash): Add support for diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index fb33c16d4..4ede00095 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -691,7 +691,7 @@ static errcode_t unix_set_option(io_channel channel, const char *option, const char *arg) { struct unix_private_data *data; - unsigned long tmp; + unsigned long long tmp; char *end; EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); @@ -702,10 +702,12 @@ static errcode_t unix_set_option(io_channel channel, const char *option, if (!arg) return EXT2_ET_INVALID_ARGUMENT; - tmp = strtoul(arg, &end, 0); + tmp = strtoull(arg, &end, 0); if (*end) return EXT2_ET_INVALID_ARGUMENT; data->offset = tmp; + if (data->offset < 0) + return EXT2_ET_INVALID_ARGUMENT; return 0; } return EXT2_ET_INVALID_ARGUMENT;