summaryrefslogtreecommitdiff
path: root/myisam/myisamlog.c
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-08-26 22:02:58 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2003-08-26 22:02:58 +0300
commit70631cff85742bfd8e8deb4e174eb6e74f017800 (patch)
treef2569d8f0b07e5625445e0c965a6846267b71ccf /myisam/myisamlog.c
parent7a21caabab32c3cce0357fbccf772b2af482d470 (diff)
downloadmariadb-git-70631cff85742bfd8e8deb4e174eb6e74f017800.tar.gz
Fixed a very rarge memory overrun bug in the myisamlog program.
Diffstat (limited to 'myisam/myisamlog.c')
-rw-r--r--myisam/myisamlog.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c
index ceca8d2a0e3..091f9ad1d7e 100644
--- a/myisam/myisamlog.c
+++ b/myisam/myisamlog.c
@@ -413,8 +413,16 @@ static int examine_log(my_string file_name, char **table_names)
VOID(tree_walk(&tree,(tree_walk_action) test_if_open,(void*) &open_param,
left_root_right));
file_info.id=open_param.max_id+1;
+ /*
+ * In the line below +10 is added to accomodate '<' and '>' chars
+ * plus '\0' at the end, so that there is place for 7 digits.
+ * It is improbable that same table can have that many entries in
+ * the table cache.
+ * The additional space is needed for the sprintf commands two lines
+ * below.
+ */
file_info.show_name=my_memdup(isam_file_name,
- (uint) strlen(isam_file_name)+6,
+ (uint) strlen(isam_file_name)+10,
MYF(MY_WME));
if (file_info.id > 1)
sprintf(strend(file_info.show_name),"<%d>",file_info.id);