From 5a9f6ad9b723e21c5b7c23b7779bae7481c8f38a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 9 May 2017 20:45:09 +0200 Subject: [PATCH] Try to prevent null pointer dereference --- libretro-common/file/config_file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 65fe3f96e2..983ef103aa 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -270,8 +270,9 @@ static void add_sub_conf(config_file_t *conf, char *line) real_path[0] = '\0'; #ifdef _WIN32 - fill_pathname_resolve_relative(real_path, conf->path, - path, sizeof(real_path)); + if (!string_is_empty(conf->path)) + fill_pathname_resolve_relative(real_path, conf->path, + path, sizeof(real_path)); #else #ifndef __CELLOS_LV2__ if (*path == '~') @@ -282,8 +283,9 @@ static void add_sub_conf(config_file_t *conf, char *line) } else #endif - fill_pathname_resolve_relative(real_path, conf->path, - path, sizeof(real_path)); + if (!string_is_empty(conf->path)) + fill_pathname_resolve_relative(real_path, conf->path, + path, sizeof(real_path)); #endif sub_conf = (config_file_t*)