From 486c86dd391546fcd181cf4767768b2ee4986ef2 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 19 Jan 2018 19:56:34 +0200 Subject: Added some checking that LEX_CSTRING is \0 terminated - When adding LEX_CSTRING to String, we are now checking that string is \0 terminated (as normally LEX_CSTRING should be usable for printf(). In the cases when one wants to avoid the checking one can use String->append(ptr, length) instead of just String->append(LEX_CSTRING*) --- sql/sp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sp.cc') diff --git a/sql/sp.cc b/sql/sp.cc index 56d6a8ed261..72257a4a332 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -2328,7 +2328,7 @@ Sp_handler::show_create_sp(THD *thd, String *buf, buf->append(STRING_WITH_LEN(" DETERMINISTIC\n")); append_suid(buf, chistics.suid); append_comment(buf, chistics.comment); - buf->append(&body); + buf->append(body.str, body.length); // Not \0 terminated thd->variables.sql_mode= old_sql_mode; return false; } -- cgit v1.2.1