diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-14 23:26:54 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | a89747a5c8657e93e20834c6f2bc61a1b8e0ad29 (patch) | |
| tree | 6d35ff9928688a14ef969ab21a3ab615253bdbb2 | |
| parent | 13006f25165683e036fa3c77572bed86ad0789ba (diff) | |
util/nvmutil: rw_over_nrw: err if nrw is zero
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 2e718b23..d9c09bc4 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -2149,6 +2149,14 @@ err_is_file: static ssize_t rw_over_nrw(ssize_t r, size_t nrw) { + /* + * If a byte length of zero + * was requested, that is + * clearly a bug. No way. + */ + if (!nrw) + goto err_rw_over_nrw; + if (r == -1) return r; |
