summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem.bichot@oracle.com>2011-02-11 15:00:09 +0100
committerGuilhem Bichot <guilhem.bichot@oracle.com>2011-02-11 15:00:09 +0100
commit77c0f33ee2b2ad46088364630275735f9d744ed2 (patch)
treed9d6129bd645413a78561d42f1fdc9c9b94cb638 /mysys/my_getopt.c
parente9fc441a525de89be0295ef1766c72a7e39c9b1d (diff)
downloadmariadb-git-77c0f33ee2b2ad46088364630275735f9d744ed2.tar.gz
Fix for BUG#59894
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings": due to prefix support, the argument "e" was overwritten with its full value "engine_condition_pushdown", which caused a buffer overrun. This was wrong usage of find_type(); other wrong usages are fixed here too. Please start reading with the comment of typelib.c.
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 6f7ed070ccf..ac4ae46eab5 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -695,7 +695,7 @@ static int setval(const struct my_option *opts, void *value, char *argument,
break;
case GET_ENUM:
{
- int type= find_type(argument, opts->typelib, 2);
+ int type= find_type(argument, opts->typelib, FIND_TYPE_BASIC);
if (type == 0)
{
/*