Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

syonbori
Copy link

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 :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant