fsync_dir: abort if path length is empty

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-16 21:15:01 +00:00
parent ed9eae213b
commit 26a2224d82

View File

@@ -2135,6 +2135,12 @@ fsync_dir(const char *path)
goto err_fsync_dir;
}
if (pathlen == 0)
{
errno = EINVAL;
goto err_fsync_dir;
}
dirbuf = malloc(pathlen + 1);
if (dirbuf == NULL)
goto err_fsync_dir;