diff options
author | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2010-12-01 15:56:46 +0300 |
---|---|---|
committer | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2010-12-01 15:56:46 +0300 |
commit | 45f6f933d16722391002a0bd358456dc6386e8ee (patch) | |
tree | d49a55d8fe727fc8e448bd19790e7a10d42b9902 /mysys | |
parent | 8f620f39e50ac77518a22fb4d409ef8e058c87a1 (diff) | |
download | mariadb-git-45f6f933d16722391002a0bd358456dc6386e8ee.tar.gz |
BUG#58205 - Valgrind failure in fn_format when called from
archive_discover
Fixed buffer underrun in cleanup_dirname().
Also fixed that original (unencoded) database and table
names were used to discover archive tables.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_pack.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index c6e6a3a429e..a9482187138 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -192,7 +192,8 @@ size_t cleanup_dirname(register char *to, const char *from) end_parentdir=pos; while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */ pos--; - if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0) + if (pos[1] == FN_HOMELIB || + (pos > start && memcmp(pos, parent, length) == 0)) { /* Don't remove ~user/ */ pos=strmov(end_parentdir+1,parent); *pos=FN_LIBCHAR; |