mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-02 04:02:23 +03:00
CPack/DragNDrop: Avoid crash when locale identifier creation fails
If `CFLocaleCreateCanonicalLanguageIdentifierFromString` fails, stop gracefully. Otherwise we crash because `CFStringGetCString` cannot work with null `CFStrings`.
This commit is contained in:
1 parent
cfcff29087
commit
bbc98fb67a
1 file changed
+1
@@ -601,6 +601,7 @@ int cmCPackDragNDropGenerator::CreateDMG(std::string const& src_dir,
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||
language << " is not a recognized language"
|
||||
<< std::endl);
|
||||
return 0;
|
||||
}
|
||||
char iso_language_cstr[65];
|
||||
CFStringGetCString(iso_language, iso_language_cstr,
|
||||
|
||||
Reference in new issue
Block a user