mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 14:48:19 -05:00
foreach: Fix crash parsing integer out of range
This commit is contained in:
@@ -365,6 +365,12 @@ bool TryParseInteger(cmExecutionStatus& status, const std::string& str, int& i)
|
||||
status.SetError(e.str());
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return false;
|
||||
} catch (std::out_of_range&) {
|
||||
std::ostringstream e;
|
||||
e << "Integer out of range: '" << str << "'";
|
||||
status.SetError(e.str());
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user