When parsing options, make sure we have found a proper token before
doing a numeric conversion.
Without this check, the current code will end up following random
pointers that just happened to be on the stack when this function was
called, because match_token() will not touch the 'args' list unless a
valid token is found.
Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
                if (!*p)
                        continue;
                token = match_token(p, tokens, args);
+               if (token == Opt_err)
+                       continue;
                r = match_int(&args[0], &option);
                if (r < 0) {
                        p9_debug(P9_DEBUG_ERROR,