mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-28 11:48:36 -06: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:
@@ -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