From 23bd61a141a3dcc522a751455a08c96c787fd45d Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 5 Jan 2018 18:58:45 +0000 Subject: [PATCH] Fix warning --- sql/log_event.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 7efd0b032606c..1449befc7484f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -14536,7 +14536,8 @@ st_print_event_info::st_print_event_info() bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_STRING *to) { reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE); - if (!(to->str= (char*) my_malloc((to->length= cache->end_of_file), MYF(0)))) + if (cache->end_of_file > SIZE_T_MAX || + !(to->str= (char*) my_malloc((to->length= (size_t)cache->end_of_file), MYF(0)))) { perror("Out of memory: can't allocate memory in copy_event_cache_to_string_and_reinit()."); goto err;