List:Commits« Previous MessageNext Message »
From:Alexey Botchkov Date:October 8 2009 9:56am
Subject:bzr commit into mysql-5.4 branch (holyfoot:2814) Bug#46570
View as plain text  
#At file:///home/hf/work/mysql_common/46570/ based on revid:jon.hauglid@stripped

 2814 Alexey Botchkov	2009-10-08
      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.

    modified:
      sql/item_func.cc
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-07-28 22:45:02 +0000
+++ b/sql/item_func.cc	2009-10-08 09:54:01 +0000
@@ -3012,7 +3012,7 @@ udf_handler::fix_fields(THD *thd, Item_r
           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;
         }


Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20091008095401-rxb9ae7j12mfy1iv.bundle
Thread
bzr commit into mysql-5.4 branch (holyfoot:2814) Bug#46570Alexey Botchkov8 Oct