From cb8ac86bd4595879c592eb32f3b71a0236e16c42 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 17 Mar 2026 18:19:40 +0000 Subject: util/nvmutil: add defensive buffer check Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/nvmutil') 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"); -- cgit v1.2.1