From bc84be595693ea59f1cd8652d0e1286599955c90 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Tue, 12 Oct 2010 23:28:03 +0400 Subject: Fix for bug#57283: inet_ntoa() crashes Problem: some call of INET_NTOA() function may lead to a crash due to missing its character set initialization. Fix: explicitly set the character set. mysql-test/r/func_misc.result: Fix for bug#57283: inet_ntoa() crashes - test result. mysql-test/t/func_misc.test: Fix for bug#57283: inet_ntoa() crashes - test case. sql/item_strfunc.cc: Fix for bug#57283: inet_ntoa() crashes - explicitly set buffer's character set. --- sql/item_strfunc.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql') diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9f06a4b5c9f..8fda281bd9e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3135,6 +3135,7 @@ String* Item_func_inet_ntoa::val_str(String* str) if ((null_value= (args[0]->null_value || n > (ulonglong) LL(4294967295)))) return 0; // Null value + str->set_charset(collation.collation); str->length(0); int4store(buf,n); -- cgit v1.2.1