From 3bea4a20a4d9ddce774512bbe53ea47a44754c49 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Tue, 8 Feb 2011 11:21:14 +0100 Subject: 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. --- mysys/mf_format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysys/mf_format.c') 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)); -- cgit v1.2.1