projects
/
fw
/
stlink
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
deaca4e
)
Fix segv if only --reset option given
author
Pete
<petiepooo@gmail.com>
Mon, 10 Mar 2014 18:32:09 +0000
(14:32 -0400)
committer
Pete
<petiepooo@gmail.com>
Mon, 10 Mar 2014 18:32:09 +0000
(14:32 -0400)
We didn't recheck that there are enough parameters after shifting the --reset option off the list.
flash/main.c
patch
|
blob
|
history
diff --git
a/flash/main.c
b/flash/main.c
index 014b627e9da288df2c8434bdebf176228827ecd6..d550eeeeda9c158c34d6a06a0341d20aaf07ef14 100644
(file)
--- 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;