mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
libc: fix DIOCGMEDIASIZE handling in VFS plugin
Use the provided argp pointer to store the result but bail out early if it points into the void. Issue #2558.
This commit is contained in:
parent
2f32308c0b
commit
3b5a34c163
@ -719,6 +719,11 @@ int Libc::Vfs_plugin::ioctl(Libc::File_descriptor *fd, int request, char *argp)
|
||||
|
||||
case DIOCGMEDIASIZE:
|
||||
{
|
||||
if (!argp) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
opcode = Opcode::IOCTL_OP_DIOCGMEDIASIZE;
|
||||
arg = 0;
|
||||
break;
|
||||
@ -771,7 +776,7 @@ int Libc::Vfs_plugin::ioctl(Libc::File_descriptor *fd, int request, char *argp)
|
||||
/* resolve ambiguity with libc type */
|
||||
using Genode::int64_t;
|
||||
|
||||
int64_t *disk_size = (int64_t*)arg;
|
||||
int64_t *disk_size = (int64_t*)argp;
|
||||
*disk_size = out.diocgmediasize.size;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user