summaryrefslogtreecommitdiff
path: root/mysys
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
commit679bf55a033e93b26d98aac14705a72eedaf2ae8 (patch)
tree800ef6bb7f5aa59169040c94aed64dcdb4bcf315 /mysys
parente2d6be42dca9bd8963deef5856d227131820d51c (diff)
downloadmariadb-git-679bf55a033e93b26d98aac14705a72eedaf2ae8.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')
-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)