summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2010-03-23 17:00:50 +0200
committerAndrei Elkin <aelkin@mysql.com>2010-03-23 17:00:50 +0200
commit649ec7758ff0da5355f04d717d57e50fe452e3c0 (patch)
treebb7e116e3a64ea181be6c9b1c7d3da3a62415d22 /sql/protocol.cc
parenta35418784bc35f5b6c461689c954bdcfbb4c9b33 (diff)
downloadmariadb-git-649ec7758ff0da5355f04d717d57e50fe452e3c0.tar.gz
Bug #52304 valgrind does not like to print un-inited string in Protocol_text::store()
The reason of the failure was apparent flaw in that a pointer to an uninitialized buffer was passed to DBUG_PRINT of Protocol_text::store(). Fixed with splitting the print-out into two branches: one with length zero of the problematic arg and the rest. sql/protocol.cc: correcting DBUG_PRINT to print out `from' with a care because one may be uninitialized in the caller.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index fad84f8be40..dc53e029647 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -850,7 +850,7 @@ 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, from));
+ field_count, (length == 0? "" : from)));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||