From 5794c2051c696c59759e268c148f8e8e6609fed3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 6 May 2019 03:09:44 +0200 Subject: [PATCH] path_mkdir - safety check --- libretro-common/file/file_path.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 53f1cced3f..b412fd8d44 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -205,6 +205,10 @@ bool path_mkdir(const char *dir) /* Use heap. Real chance of stack * overflow if we recurse too hard. */ basedir = strdup(dir); + + if (!basedir) + return false; + path_parent_dir(basedir); if (!*basedir || !strcmp(basedir, dir))