diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-16 21:15:01 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:42 +0000 |
| commit | 47a654a870dcd233b68c3996ab6fb4597e50329e (patch) | |
| tree | c1b02e81d3e7e01f9c3c3b12d66c3d4468806782 | |
| parent | d0a125c16d83cfe95379365f93899637a31f6411 (diff) | |
fsync_dir: abort if path length is empty
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
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; |
