Fix segv if only --reset option given
[fw/stlink] / flash / main.c
index 014b627e9da288df2c8434bdebf176228827ecd6..d550eeeeda9c158c34d6a06a0341d20aaf07ef14 100644 (file)
@@ -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;