summaryrefslogtreecommitdiff
path: root/mysys/mf_format.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-09-18 22:10:06 -0600
committerunknown <sasha@mysql.sashanet.com>2000-09-18 22:10:06 -0600
commit904655e6d2db88c0b0fa16b81b09dfd998ec6ce8 (patch)
tree800ef6bb7f5aa59169040c94aed64dcdb4bcf315 /mysys/mf_format.c
parentce6b0d07214a07247b413c02d43e96af52819eeb (diff)
downloadmariadb-git-904655e6d2db88c0b0fa16b81b09dfd998ec6ce8.tar.gz
better use of fn_format() in ha_mysisam::restore() and ha_myisam::backup()
fixed buffer overflow in fn_format() mysys/mf_format.c: fixed coredump when dsk overflows sql/ha_myisam.cc: switched from my own pointer black magic in forming a file name to use the functionionality of fn_format()
Diffstat (limited to 'mysys/mf_format.c')
-rw-r--r--mysys/mf_format.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 39084799563..aa4d469e20c 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -53,7 +53,8 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
name+=(length=dirname_part(dev,(startpos=(my_string) name)));
if (length == 0 || flag & 1)
{
- (void) strmov(dev,dsk); /* Use given directory */
+ (void) strnmov(dev,dsk, sizeof(dev) - 2);
+ /* Use given directory */
convert_dirname(dev); /* Fix to this OS */
}
if (flag & 8)