path_mkdir - safety check
This commit is contained in:
parent
0919cd9746
commit
5794c2051c
1 changed files with 4 additions and 0 deletions
|
@ -205,6 +205,10 @@ bool path_mkdir(const char *dir)
|
||||||
/* Use heap. Real chance of stack
|
/* Use heap. Real chance of stack
|
||||||
* overflow if we recurse too hard. */
|
* overflow if we recurse too hard. */
|
||||||
basedir = strdup(dir);
|
basedir = strdup(dir);
|
||||||
|
|
||||||
|
if (!basedir)
|
||||||
|
return false;
|
||||||
|
|
||||||
path_parent_dir(basedir);
|
path_parent_dir(basedir);
|
||||||
|
|
||||||
if (!*basedir || !strcmp(basedir, dir))
|
if (!*basedir || !strcmp(basedir, dir))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue