Merge commit from fork

DerefExpression: Add missing nullptr check
This commit is contained in:
Julian Brost 2025-10-16 14:14:45 +02:00 committed by GitHub
commit cfff82ba05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -187,6 +187,10 @@ bool DerefExpression::GetReference(ScriptFrame& frame, bool init_dict, Value *pa
Reference::Ptr ref = operand.GetValue();
if (!ref) {
BOOST_THROW_EXCEPTION(ScriptError("Invalid reference specified.", GetDebugInfo()));
}
*parent = ref->GetParent();
*index = ref->GetIndex();
return true;

View File

@ -242,6 +242,10 @@ BOOST_AUTO_TEST_CASE(advanced)
expr = ConfigCompiler::CompileText("<test>", "{{ 3 }}");
func = expr->Evaluate(frame).GetValue();
BOOST_CHECK(func->Invoke() == 3);
// Regression test for CVE-2025-61908
expr = ConfigCompiler::CompileText("<test>", "&*null");
BOOST_CHECK_THROW(expr->Evaluate(frame).GetValue(), ScriptError);
}
BOOST_AUTO_TEST_CASE(sandboxed_ticket_salt)