Commit c3ef0267 authored by unknown's avatar unknown
Browse files

Bug#20783: Valgrind uninitialised warning in test case ctype_uca

  
Two functions have different ideas of what a string should look like;
one of them reads memory it assumes the other one may have written.
And "if you assume ..."
  
We now use a more defensive variety of the assuming function, this fixes
a warning thrown by the valgrind tool.


sql/item_cmpfunc.cc:
  c_ptr() makes incorrect assumptions about the string we get from
  out of args[0]->val_str(&tmp); c_str_safe() is more defensive.
parent e34b9cfb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3303,7 +3303,7 @@ longlong Item_func_regex::val_int()
    }
  }
  null_value=0;
  return my_regexec(&preg,res->c_ptr(),0,(my_regmatch_t*) 0,0) ? 0 : 1;
  return my_regexec(&preg,res->c_ptr_safe(),0,(my_regmatch_t*) 0,0) ? 0 : 1;
}