bug fix: 32bit overflow of offset value in Raw Read and Raw Write #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :-(