-
-
Notifications
You must be signed in to change notification settings - Fork 187
overflow risk in ioctl.cpp #1
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
Comments
FUSE's callback signature for ioctl is: int (*ioctl) (const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void *data); The man page on my Ubuntu 14.04LTS machine indicates: int ioctl(int d, int request, ...); http://man7.org/linux/man-pages/man2/ioctl.2.html indicates it's an unsigned long. Sounds like a fuse issue. Nothing I can do about it. I'm given an int. Also... the header also sets FS_IOC32_GETFLAGS as an int. So it seems unlikely the value is larger than such. Need to see how switch does value promotion for comparison. |
GCC warns with "overflow in implicit constant conversion" if the value had been an issue. I'll put in an explicit cast just in case. |
cmd in ioctl.cpp is an int, but the case variables (FS_IOC_GETFLAGS and FS_IOC_SETFLAGS) are longs.
The text was updated successfully, but these errors were encountered: