diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-17 21:43:37 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:42 +0000 |
| commit | 6e6b1dd366365cde2dcb3ea8c49e55995c606b0b (patch) | |
| tree | 20b29c000e2a3fac8d839ecebc863e029e56ffd3 /util | |
| parent | f5104c5893085c5e1bf31f06779bed522c757c29 (diff) | |
util/nvmutil: stricter work buf check
check it right after initialisation
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 8b5c4381..7652538a 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -162,16 +162,16 @@ main(int argc, char *argv[]) #endif nv = new_xstate(); + if (nv == NULL) err(errno, NULL); + if (nv->f.buf == NULL) + err(EINVAL, "Work buffer not initialised"); nv->argv0 = argv[0]; if (argc < 3) usage(); - if (nv->f.buf == NULL) - err(EINVAL, "Work buffer not initialised"); - f = &nv->f; f->fname = argv[1]; |
