mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Avoid null dereference when performing mixed content checks
Previously, navigating to or from `about:newtab` caused a crash due to inadvertent null dereferences when checking whether a request or response to a request should be blocked as mixed content.
This commit is contained in:
parent
7a04a95c8a
commit
572ebe00ea
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/572ebe00ea Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/161 Issue: https://github.com/LadybirdBrowser/ladybird/issues/160
@ -80,7 +80,7 @@ Fetch::Infrastructure::RequestOrResponseBlocking should_fetching_request_be_bloc
|
||||
|| false
|
||||
|
||||
// 4. request’s destination is "document", and request’s target browsing context has no parent browsing context.
|
||||
|| (request.destination() == Fetch::Infrastructure::Request::Destination::Document && !request.client()->target_browsing_context->parent())) {
|
||||
|| (request.destination() == Fetch::Infrastructure::Request::Destination::Document && !(request.client()->target_browsing_context && request.client()->target_browsing_context->parent()))) {
|
||||
return Fetch::Infrastructure::RequestOrResponseBlocking::Allowed;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ Web::Fetch::Infrastructure::RequestOrResponseBlocking should_response_to_request
|
||||
|| false
|
||||
|
||||
// 4. request’s destination is "document", and request’s target browsing context has no parent browsing context.
|
||||
|| (request.destination() == Fetch::Infrastructure::Request::Destination::Document && !request.client()->target_browsing_context->parent())) {
|
||||
|| (request.destination() == Fetch::Infrastructure::Request::Destination::Document && !(request.client()->target_browsing_context && request.client()->target_browsing_context->parent()))) {
|
||||
return Fetch::Infrastructure::RequestOrResponseBlocking::Allowed;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user