summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-01-05 18:58:45 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-01-05 18:58:45 +0000
commit23bd61a141a3dcc522a751455a08c96c787fd45d (patch)
tree4e19a7ae528d4113dc435a67872f345deddf1599
parent894fbe6862a1705062b132109f727fe513a8c8b5 (diff)
downloadmariadb-git-23bd61a141a3dcc522a751455a08c96c787fd45d.tar.gz
Fix warning
-rw-r--r--sql/log_event.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 7efd0b03260..1449befc748 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;