From 26a2224d82afc6e45568373d6671538be7992bb3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 16 Mar 2026 21:15:01 +0000 Subject: fsync_dir: abort if path length is empty Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util') 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; -- cgit v1.2.1