summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-16 21:15:01 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:42 +0000
commit47a654a870dcd233b68c3996ab6fb4597e50329e (patch)
treec1b02e81d3e7e01f9c3c3b12d66c3d4468806782 /util/nvmutil
parentd0a125c16d83cfe95379365f93899637a31f6411 (diff)
fsync_dir: abort if path length is empty
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 85f5d85d..719a4810 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -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;