dfs/romfs: validate ioctl args for RT_FIOGETADDR

This commit is contained in:
Aphlita
2026-05-04 18:34:59 +08:00
committed by GitHub
parent b4436e9b2e
commit c1a43bc0de
2 changed files with 10 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}