summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-06-05 10:39:02 +0200
committerunknown <joerg@trift2.>2007-06-05 10:39:02 +0200
commitb10c39f9180c1ceccadf1e8e6f5a837c871f3379 (patch)
treebf62f880cfbc70b5b2431bbad03da5454095d4ad /client
parentb4a206abdc7e47dbcb88e5b64d6f132685380484 (diff)
parentddf48bed99f612ab30069e89e4e94050931e64a9 (diff)
downloadmariadb-git-b10c39f9180c1ceccadf1e8e6f5a837c871f3379.tar.gz
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 mysql-test/mysql-test-run.pl: Auto merged mysql-test/t/mysqldump.test: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4d320964e39..8811bc4ef89 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2693,15 +2693,18 @@ static void dump_table(char *table, char *db)
plus 2 bytes for '0x' prefix.
- In non-HEX mode we need up to 2 bytes per character,
plus 2 bytes for leading and trailing '\'' characters.
+ Also we need to reserve 1 byte for terminating '\0'.
*/
- dynstr_realloc_checked(&extended_row,length * 2+2);
+ dynstr_realloc_checked(&extended_row,length * 2 + 2 + 1);
if (opt_hex_blob && is_blob)
{
dynstr_append_checked(&extended_row, "0x");
extended_row.length+= mysql_hex_string(extended_row.str +
extended_row.length,
row[i], length);
- extended_row.str[extended_row.length]= '\0';
+ DBUG_ASSERT(extended_row.length+1 <= extended_row.max_length);
+ /* mysql_hex_string() already terminated string by '\0' */
+ DBUG_ASSERT(extended_row.str[extended_row.length] == '\0');
}
else
{