diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-17 18:19:40 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-17 18:19:40 +0000 |
| commit | cb8ac86bd4595879c592eb32f3b71a0236e16c42 (patch) | |
| tree | c647d817d461ff8dd852a5e4082372687a3fed75 | |
| parent | b00fb6127e505d2fde308615a1d0785a46553b2b (diff) | |
util/nvmutil: add defensive buffer check
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 5d59e4ca..4d8ad87b 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -162,6 +162,9 @@ main(int argc, char *argv[]) if (argc < 3) usage(); + if (nv->f.buf == NULL) + err(EINVAL, "Work buffer not initialised"); + if (CHAR_BIT != 8) err(EINVAL, "Unsupported char size"); |
