diff options
author | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-02-11 15:00:09 +0100 |
---|---|---|
committer | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-02-11 15:00:09 +0100 |
commit | 77c0f33ee2b2ad46088364630275735f9d744ed2 (patch) | |
tree | d9d6129bd645413a78561d42f1fdc9c9b94cb638 /storage | |
parent | e9fc441a525de89be0295ef1766c72a7e39c9b1d (diff) | |
download | mariadb-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 'storage')
-rw-r--r-- | storage/myisam/myisamchk.c | 5 | ||||
-rw-r--r-- | storage/myisammrg/myrg_open.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 35b68fe00df..d56f1e18930 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 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 @@ -673,7 +673,8 @@ get_one_option(int optid, int method; enum_mi_stats_method UNINIT_VAR(method_conv); myisam_stats_method_str= argument; - if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + if ((method= find_type(argument, &myisam_stats_method_typelib, + FIND_TYPE_BASIC)) <= 0) { fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index c545aff912f..533e5d13cdd 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 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 @@ -77,7 +77,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { if (!strncmp(buff+1,"INSERT_METHOD=",14)) { /* Lookup insert method */ - int tmp=find_type(buff+15,&merge_insert_method,2); + int tmp= find_type(buff + 15, &merge_insert_method, FIND_TYPE_BASIC); found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); } continue; /* Skip comments */ @@ -271,7 +271,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, { /* Compare buffer with global methods list: merge_insert_method. */ insert_method= find_type(child_name_buff + 15, - &merge_insert_method, 2); + &merge_insert_method, FIND_TYPE_BASIC); } continue; } |