path_mkdir - safety check

This commit is contained in:
twinaphex 2019-05-06 03:09:44 +02:00
parent 0919cd9746
commit 5794c2051c

View File

@ -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))