summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2009-12-22 16:37:21 +0400
committerAlexey Botchkov <holyfoot@mysql.com>2009-12-22 16:37:21 +0400
commit4431827f2a87b0759dd8f2f8bb58a6dd7e6e334c (patch)
treed71154786df49e07cf5753eedeb5770412194694 /sql/item_func.cc
parentcb8b607187847b6d74b8c0078b4bff230c00cfa4 (diff)
downloadmariadb-git-4431827f2a87b0759dd8f2f8bb58a6dd7e6e334c.tar.gz
Bug#46570 test udf fails with valgrind
the value obtained by String::c_ptr() method not always has the ending zero. Particularly in this bug the dlsym() expects zero-ending string. The String::c_ptr_safe() is more correct here. per-file comments: sql/item_func.cc Bug#46570 test udf fails with valgrind c_ptr_safe() used for UDF parameters as the library expects zero-ending strings.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 6f14e69e101..c9aaa80d7d0 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2952,7 +2952,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
String *res= arguments[i]->val_str(&buffers[i]);
if (arguments[i]->null_value)
continue;
- f_args.args[i]= (char*) res->c_ptr();
+ f_args.args[i]= (char*) res->c_ptr_safe();
f_args.lengths[i]= res->length();
break;
}