diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-10-25 14:25:42 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-10-25 14:25:42 +0300 |
commit | aeccbbd926e759a5c3b9818d9948a35918404478 (patch) | |
tree | e3ee68a92d2c77f986979e1638169280ede35a96 /plugin | |
parent | 75f7c5681c2592b50c26feff2371bd7ee973e535 (diff) | |
parent | 4b4c2b8cc0da949895292121ed5ef3e0c2dbaae1 (diff) | |
download | mariadb-git-aeccbbd926e759a5c3b9818d9948a35918404478.tar.gz |
Merge 10.5 into 10.6
To prevent ASAN heap-use-after-poison in the MDEV-16549 part of
./mtr --repeat=6 main.derived
the initialization of Name_resolution_context was cleaned up.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/cracklib_password_check/cracklib_password_check.c | 2 | ||||
-rw-r--r-- | plugin/feedback/feedback.cc | 1 | ||||
-rw-r--r-- | plugin/file_key_management/parser.cc | 15 |
3 files changed, 13 insertions, 5 deletions
diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c index 20294b070e7..470e6e5280f 100644 --- a/plugin/cracklib_password_check/cracklib_password_check.c +++ b/plugin/cracklib_password_check/cracklib_password_check.c @@ -13,10 +13,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ +#include <my_global.h> #include <mysql/plugin_password_validation.h> #include <crack.h> #include <string.h> -#include <alloca.h> #include <mysqld_error.h> static char *dictionary; diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index 3b2e95f1e13..cb254d69ec3 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -102,7 +102,6 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter) if (!filter->str || !nrc) return 0; - nrc->init(); nrc->resolve_in_table_list_only(tables); nrc->select_lex= tables->select_lex; diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc index 818c026495f..57e0139a57d 100644 --- a/plugin/file_key_management/parser.cc +++ b/plugin/file_key_management/parser.cc @@ -162,19 +162,28 @@ bool Parser::read_filekey(const char *filekey, char *secret) int f= open(filekey, O_RDONLY|O_BINARY); if (f == -1) { - my_error(EE_FILENOTFOUND,ME_ERROR_LOG, filekey, errno); + my_error(EE_FILENOTFOUND, ME_ERROR_LOG, filekey, errno); return 1; } - int len= read(f, secret, MAX_SECRET_SIZE); + int len= read(f, secret, MAX_SECRET_SIZE + 1); if (len <= 0) { - my_error(EE_READ,ME_ERROR_LOG, filekey, errno); + my_error(EE_READ, ME_ERROR_LOG, filekey, errno); close(f); return 1; } close(f); + while (secret[len - 1] == '\r' || secret[len - 1] == '\n') len--; + if (len > MAX_SECRET_SIZE) + { + my_printf_error(EE_READ, + "Cannot read %s, the filekey is too long, " + "max secret size is %dB ", + ME_ERROR_LOG, filekey, MAX_SECRET_SIZE); + return 1; + } secret[len]= '\0'; return 0; } |