Fix potential NULL pointer dereference introduced by last commit

This commit is contained in:
Mike Gelfand 2017-10-31 10:01:06 +03:00
parent 474aabbbc4
commit ede21744d3
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ static bool create_path(char const* path_in, int permissions, tr_error** error)
}
/* Go one level down on each iteration and attempt to create */
for (; pp < path_end; pp += strlen(pp))
for (pp = pp == NULL ? p + strlen(p) : pp; pp < path_end; pp += strlen(pp))
{
*pp = TR_PATH_DELIMITER;