mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
patterns: Disallow calling of dangerous functions by default
Closes #330
This commit is contained in:
@@ -127,6 +127,11 @@ namespace hex::pl {
|
||||
this->m_scopes.clear();
|
||||
this->m_aborted = false;
|
||||
|
||||
if (this->m_allowDangerousFunctions == DangerousFunctionPermission::Deny)
|
||||
this->m_allowDangerousFunctions = DangerousFunctionPermission::Ask;
|
||||
|
||||
this->m_dangerousFunctionCalled = false;
|
||||
|
||||
ON_SCOPE_EXIT {
|
||||
this->m_envVariables.clear();
|
||||
};
|
||||
|
||||
@@ -185,4 +185,13 @@ namespace hex::pl {
|
||||
return this->m_evaluator->getPatternLimit();
|
||||
}
|
||||
|
||||
|
||||
void PatternLanguage::allowDangerousFunctions(bool allow) {
|
||||
this->m_evaluator->allowDangerousFunctions(allow);
|
||||
}
|
||||
|
||||
bool PatternLanguage::hasDangerousFunctionBeenCalled() const {
|
||||
return this->m_evaluator->hasDangerousFunctionBeenCalled();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user