Skip to content

Commit

Permalink
Fix stack overflow in CreatePath
Browse files Browse the repository at this point in the history
  • Loading branch information
palana committed Sep 23, 2014
1 parent f629824 commit ca33d44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OBSApi/Utility/XFile_Windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,13 @@ BOOL CreatePath(CTSTR lpPath)
if(OSCreateDirectory(lpPath))
return true;
else
if(!CreatePath(GetPathDirectory(lpPath)))
{
String parent = GetPathDirectory(lpPath);
if (parent == lpPath)
return false;
if (!CreatePath(parent))
return false;
}
return OSCreateDirectory(lpPath);
}

Expand Down

0 comments on commit ca33d44

Please sign in to comment.