mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-12 21:25:53 +00:00
dfs/romfs: validate ioctl args for RT_FIOGETADDR
This commit is contained in:
@@ -44,6 +44,11 @@ int dfs_romfs_ioctl(struct dfs_file *file, int cmd, void *args)
|
||||
{
|
||||
case RT_FIOGETADDR:
|
||||
{
|
||||
if (args == RT_NULL)
|
||||
{
|
||||
ret = -RT_EINVAL;
|
||||
break;
|
||||
}
|
||||
*(rt_ubase_t*)args = (rt_ubase_t)dirent->data;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,11 @@ int dfs_romfs_ioctl(struct dfs_file *file, int cmd, void *args)
|
||||
{
|
||||
case RT_FIOGETADDR:
|
||||
{
|
||||
if (args == RT_NULL)
|
||||
{
|
||||
ret = -RT_EINVAL;
|
||||
break;
|
||||
}
|
||||
*(rt_ubase_t*)args = (rt_ubase_t)dirent->data;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user