mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Visit internal fields of Crypto in visit_edges
Not visiting the field holding SubtleCrypto in Crypto caused subtle crashes all over the Value functions, due to accessing SubtleCrypto after it was garbage collected (and potentially replaced by a new cell). This meant that the crashes were only appearing in Value::to_boolean, Value::typeof, etc. Which then held pointer to things that looked like Shapes, Environments and other non-Object Cells. To find the actual cause, all pointer used to construct Values were checked and if a pointer was none of the allowed types, the backtrace is logged. Co-authored-by: Luke Wilde <lukew@serenityos.org>
This commit is contained in:
parent
0e901f8c68
commit
1d846e5591
Notes:
sideshowbarker
2024-07-17 07:13:50 +09:00
Author: https://github.com/davidot
Commit: 1d846e5591
Pull-request: https://github.com/SerenityOS/serenity/pull/15217
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 9 additions and 0 deletions
|
@ -114,4 +114,10 @@ String Crypto::random_uuid() const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
void Crypto::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_subtle.ptr());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue