summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authorunknown <tsmith@quadxeon.mysql.com>2007-06-05 23:04:40 +0200
committerunknown <tsmith@quadxeon.mysql.com>2007-06-05 23:04:40 +0200
commitf5bc5381ae6142c4de27b282fb9cd63130b174f6 (patch)
treebe4ad3f767cede727abc63a97dde0d92d211f27b /client/mysqldump.c
parentbf70c5dfbc75cd0e84f7284042932ec3a983ed58 (diff)
parente409a8a5c0402859ec0754e5d060e3ae06df4c6e (diff)
downloadmariadb-git-f5bc5381ae6142c4de27b282fb9cd63130b174f6.tar.gz
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50 client/mysqldump.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index a70098d0eb6..fc461a5f559 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2535,15 +2535,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
{