Skip to content

Commit

Permalink
Fixed wrong usage strlen(), should be sizeof()
Browse files Browse the repository at this point in the history
Found by running valgrind on mtr tests
  • Loading branch information
montywi committed Mar 22, 2021
1 parent cebf9ee commit d902b53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/sql_prepare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3419,7 +3419,7 @@ static void mysql_stmt_execute_common(THD *thd,
Set thd->query_string with the stmt_id so the
audit plugin gets the meaningful notification.
*/
if (alloc_query(thd, llbuf, strlen(llbuf)))
if (alloc_query(thd, llbuf, sizeof(llbuf)))
thd->set_query(0, 0);
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_execute");
Expand Down

0 comments on commit d902b53

Please sign in to comment.