Skip to content

Commit

Permalink
MDEV-9577: sys_vars.ignore_db_dirs_basic fails under Valgrind
Browse files Browse the repository at this point in the history
Ensure that the command line argument is of sufficient length
before moving past the leading long option marker "--".
  • Loading branch information
Nirbhay Choubey committed Feb 17, 2016
1 parent 0225962 commit 3042d65
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sql/wsrep_check_opts.cc
Expand Up @@ -151,7 +151,20 @@ find_opts (argv_copy& a, struct opt* const opts)
{
for (int i = 0; i < a.argc_; ++i)
{
char* ptr = a.argv_[i] + 2; // we're interested only in long options
char *ptr;

/*
We're interested only in long options, ensure that the arg is of
sufficient length.
*/
if (strlen(a.argv_[i]) > 2)
{
ptr= a.argv_[i] + 2;
}
else
{
continue;
}

struct opt* opt = opts;
for (; 0 != opt->name; ++opt)
Expand Down

0 comments on commit 3042d65

Please sign in to comment.