mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: call usage if argc below 3
otherwise, we invoke the state machine in weird conditions, where some pointers may not be initialised. we could handle this properly, but why? therefore, the errhook is called after the argc check. this patch fixes a Speicherzugriffsfehler that i got while running nvmutil with below 3 arguments Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -32,8 +32,11 @@ main(int argc, char *argv[])
|
||||
struct xfile *f;
|
||||
size_t c;
|
||||
|
||||
(void) errhook(exit_cleanup);
|
||||
(void) lbsetprogname(argv[0]);
|
||||
if (argc < 3)
|
||||
usage();
|
||||
|
||||
(void) errhook(exit_cleanup);
|
||||
|
||||
/* https://man.openbsd.org/pledge.2 */
|
||||
/* https://man.openbsd.org/unveil.2 */
|
||||
|
||||
Reference in New Issue
Block a user