mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
MDEV-11641 innobase_get_stmt_safe() does not copy the last byte of thd->query_string
innobase_get_stmt_safe(): Copy also the last byte.
This commit is contained in:
parent
703d0985ee
commit
a90066b1c7
1 changed files with 2 additions and 2 deletions
|
@ -2465,8 +2465,8 @@ innobase_get_stmt_safe(
|
|||
stmt = thd ? thd_query_string(thd) : NULL;
|
||||
|
||||
if (stmt && stmt->str) {
|
||||
length = stmt->length > buflen ? buflen : stmt->length;
|
||||
memcpy(buf, stmt->str, length-1);
|
||||
length = stmt->length >= buflen ? buflen - 1 : stmt->length;
|
||||
memcpy(buf, stmt->str, length);
|
||||
buf[length]='\0';
|
||||
} else {
|
||||
buf[0]='\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue