From 1d72edd132b348de0e66c08c6df895043ba34981 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 27 Oct 2018 00:35:07 -0400 Subject: fixes #763 buffer overrun in options test --- src/supplemental/util/options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/supplemental/util/options.c b/src/supplemental/util/options.c index 826a3692..711635e2 100644 --- a/src/supplemental/util/options.c +++ b/src/supplemental/util/options.c @@ -23,12 +23,13 @@ nng_opts_parse(int argc, char *const *argv, const nng_optspec *opts, int *val, int matches; bool shortopt; size_t l; - char * arg = argv[*optidx]; + char * arg; int i; if ((i = *optidx) >= argc) { return (-1); } + arg = argv[*optidx]; if (arg[0] != '-') { return (-1); -- cgit v1.2.3-70-g09d2