summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-07-15 16:25:00 +0400
committerAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-07-15 16:25:00 +0400
commit56931dd0155756562ec4288e1732d99b996593dc (patch)
treee42fa4e9075d63e305ee5c14a719f9f931b78040 /sql/protocol.cc
parent72857dc89cfe71eda4311a91e915d5a4ddde624e (diff)
downloadmariadb-git-56931dd0155756562ec4288e1732d99b996593dc.tar.gz
Backport a fix for Bug#59060 (Valgrind warning in Protocol_text::store()).
Original changeset: revision-id: alexander.nozdrin@oracle.com-20101221122349-6h8ammcro70a4pac parent: sven.sandberg@oracle.com-20101221121948-hnivuulyohzch1v4 committer: Alexander Nozdrin <alexander.nozdrin@oracle.com> branch nick: mysql-trunk-bugfixing timestamp: Tue 2010-12-21 15:23:49 +0300 message: A patch for Bug#59060 (Valgrind warning in Protocol_text::store()). We should not assume to have zero-terminated strings.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index b7be3f71d8e..8b652fe855a 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -857,8 +857,8 @@ bool Protocol_text::store(const char *from, size_t length,
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
- DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos,
- field_count, (length == 0? "" : from)));
+ DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*s", field_pos,
+ field_count, (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||