fusefs icon indicating copy to clipboard operation
fusefs copied to clipboard

bug fix: 32bit overflow of offset value in Raw Read and Raw Write

Open syonbori opened this issue 14 years ago • 0 comments

hello duairc.

i found a bug related to offset overflow today. so i checked fuse_lib.c, and found it. ( requesting over 2,147,483,647, 2^32-1, causes offset value to be negative value. )

type of the argument, off_t offset, is valid, but converting the value into Ruby's value causes this overflow. INT2NUM(offset) --> LONG2NUM(offset)

on my environment, Fedora12@x86-64 and CentOS5@i686 can make successfully. fixing this, i confirmed to works fine like this: dd if=fuse/image.dat of=/dev/null bs=1M count=256, skip=2047 (without this fix, requesting to 2048th block causes overflow. fusefs calls raw_read with negative offset.)

PS: sorry for adding some emptyline diffs in this request... i think this is caused by emacs, but i don't know why this happend and how to stop it :-(

syonbori avatar Feb 22 '11 13:02 syonbori