Firefox · Networking
CVE-2024-9402
Memory Corruption in Networking
Overview
High
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Changed Functions
| Function | Change | Notes |
|---|---|---|
Cancelnetwerk/dns/DNSRequestChild.cpp |
modified | |
ifnetwerk/dns/DNSRequestChild.cpp |
modified |
Files Changed
netwerk/dns/DNSRequestChild.cpp
Patch
diff --git a/netwerk/dns/DNSRequestChild.cpp b/netwerk/dns/DNSRequestChild.cpp
index 2d02bd5c8ba..923d6e677f5 100644
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -391,29 +391,26 @@ void DNSRequestSender::OnRecvCancelDNSRequest(
NS_IMETHODIMP
DNSRequestSender::Cancel(nsresult reason) {
- if (!mIPCActor) {
+ if (!mIPCActor || !mIPCActor->CanSend()) {
return NS_ERROR_NOT_AVAILABLE;
}
- // We can only do IPC on the MainThread
- nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
- "net::CancelDNSRequestEvent",
- [actor(mIPCActor), host(mHost), trrServer(mTrrServer), port(mPort),
- type(mType), originAttributes(mOriginAttributes), flags(mFlags),
- reason]() {
- if (!actor->CanSend()) {
- return;
- }
-
- if (DNSRequestChild* child = actor->AsDNSRequestChild()) {
- Unused << child->SendCancelDNSRequest(
- host, trrServer, port, type, originAttributes, flags, reason);
- } else if (DNSRequestParent* parent = actor->AsDNSRequestParent()) {
- Unused << parent->SendCancelDNSRequest(
- host, trrServer, port, type, originAttributes, flags, reason);
- }
- });
- SchedulerGroup::Dispatch(runnable.forget());
+ // we can only do IPC on the MainThread
+ if (!NS_IsMainThread()) {
+ SchedulerGroup::Dispatch(
+ NewRunnableMethod<nsresult>("net::DNSRequestSender::Cancel", this,
+ &DNSRequestSender::Cancel, reason));
+ return NS_OK;
+ }
+
+ if (DNSRequestChild* child = mIPCActor->AsDNSRequestChild()) {
+ Unused << child->SendCancelDNSRequest(mHost, mTrrServer, mPort, mType,
+ mOriginAttributes, mFlags, reason);
+ } else if (DNSRequestParent* parent = mIPCActor->AsDNSRequestParent()) {
+ Unused << parent->SendCancelDNSRequest(mHost, mTrrServer, mPort, mType,
+ mOriginAttributes, mFlags, reason);
+ }
+
return NS_OK;
}
Loading diff…
References
On This Page