diff options
author | Mats Kindahl <mats.kindahl@oracle.com> | 2011-02-08 11:21:14 +0100 |
---|---|---|
committer | Mats Kindahl <mats.kindahl@oracle.com> | 2011-02-08 11:21:14 +0100 |
commit | 3bea4a20a4d9ddce774512bbe53ea47a44754c49 (patch) | |
tree | 4f761a6febac5039918f44935125c7e869c35fae /mysys/mf_format.c | |
parent | 37adcd8c400c03d0bbb36c8a7505b1c747d2763d (diff) | |
download | mariadb-git-3bea4a20a4d9ddce774512bbe53ea47a44754c49.tar.gz |
Bug #58455
Starting mysqld with defaults file without
extension cause segmentation fault
Bug occurs because fn_expand calls fn_format
with NULL as ext.
This is a backport of the patch from 5.6.
Patch solve this problem by using an empty
string as extension, and adding assertions
to fn_format that correct arguments are passed.
It also add a test tests several variations of
using non-existing defaults files.
Diffstat (limited to 'mysys/mf_format.c')
-rw-r--r-- | mysys/mf_format.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/mf_format.c b/mysys/mf_format.c index 6afa2938fa3..74f114a966f 100644 --- a/mysys/mf_format.c +++ b/mysys/mf_format.c @@ -31,6 +31,8 @@ char * fn_format(char * to, const char *name, const char *dir, reg1 size_t length; size_t dev_length; DBUG_ENTER("fn_format"); + DBUG_ASSERT(name != NULL); + DBUG_ASSERT(extension != NULL); DBUG_PRINT("enter",("name: %s dir: %s extension: %s flag: %d", name,dir,extension,flag)); |