diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-17 18:19:40 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:42 +0000 |
| commit | 38022c5d479c4a312bc1820336b43d9eabb4cb5a (patch) | |
| tree | 4bf3a34e9813759249f043956174e4060a7c4798 /util | |
| parent | 400369b361ccfe2ddc8f49d2ca2e6d4e627b7746 (diff) | |
util/nvmutil: add defensive buffer check
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -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"); |
