summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com>2006-07-03 21:41:15 +0200
committerunknown <tnurnberg@mysql.com>2006-07-03 21:41:15 +0200
commitc3ef02679edb4dccba74b8a54323cfc999137865 (patch)
treecdc1f5ac6fc0072fb2c6f2d40795644514f39051 /sql/item_cmpfunc.cc
parente34b9cfb4a295ef767dd543acc42fefea6b0bc11 (diff)
downloadmariadb-git-c3ef02679edb4dccba74b8a54323cfc999137865.tar.gz
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.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index ffacddd534a..98453899375 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -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;
}