Skip to content

Commit 3db8638

Browse files
authored
Merge pull request #2709 from compnerd/bundle
CoreFoundation: ensure that the bundle path exists
2 parents 1f6972f + c1fd75d commit 3db8638

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CoreFoundation/PlugIn.subproj/CFBundle_Executable.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ static CFURLRef _CFBundleCopyBundleURLForExecutablePath(CFStringRef str) {
344344
buffLen += extensionLength;
345345
outstr = CFStringCreateWithCharactersNoCopy(kCFAllocatorSystemDefault, buff, buffLen, kCFAllocatorNull);
346346
url = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, outstr, PLATFORM_PATH_STYLE, true);
347+
if (!_CFURLExists(url)) {
348+
CFRelease(url);
349+
url = NULL;
350+
}
347351
CFRelease(outstr);
348352
}
349353
}

0 commit comments

Comments
 (0)