From 9b1c00452a251fe516dd0248fbdf05990d217710 Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 10 Mar 2014 14:32:09 -0400 Subject: [PATCH] Fix segv if only --reset option given We didn't recheck that there are enough parameters after shifting the --reset option off the list. --- flash/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flash/main.c b/flash/main.c index 014b627..d550eee 100644 --- a/flash/main.c +++ b/flash/main.c @@ -48,6 +48,8 @@ static int get_opts(struct opts* o, int ac, char** av) { o->reset = 0; } + + if (ac < 1) return -1; /* stlinkv2 */ o->devname = NULL; -- 2.30.2