diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-16 21:15:01 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-16 21:15:01 +0000 |
| commit | 26a2224d82afc6e45568373d6671538be7992bb3 (patch) | |
| tree | a05f503823d04fa179d43b3ec9270741abf8bf71 /util/nvmutil/nvmutil.c | |
| parent | ed9eae213b0dda3238d7e03320562544a71beb1a (diff) | |
fsync_dir: abort if path length is empty
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -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; |
