summaryrefslogtreecommitdiff
path: root/mysys/default.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/default.c')
-rw-r--r--mysys/default.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/default.c b/mysys/default.c
index 9510cfb3464..6e40c48d82a 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -579,7 +579,9 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
value_end=value;
/* remove quotes around argument */
- if ((*value == '\"' || *value == '\'') && *value == value_end[-1])
+ if ((*value == '\"' || *value == '\'') && /* First char is quote */
+ (value + 1 < value_end ) && /* String is longer than 1 */
+ *value == value_end[-1] ) /* First char is equal to last char */
{
value++;
value_end--;