Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1914)

Unified Diff: content/browser/renderer_host/websocket_dispatcher_host.cc

Issue 148263009: Fix UAF in WebSocketDispatcherHost (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/websocket_dispatcher_host.cc
diff --git a/content/browser/renderer_host/websocket_dispatcher_host.cc b/content/browser/renderer_host/websocket_dispatcher_host.cc
index 5ce07985d79eb59b203a7917b65cad0af7bcaf4f..ece71cbdf872b964815c3f733b3afe904cc6dea6 100644
--- a/content/browser/renderer_host/websocket_dispatcher_host.cc
+++ b/content/browser/renderer_host/websocket_dispatcher_host.cc
@@ -83,10 +83,13 @@ WebSocketHost* WebSocketDispatcherHost::GetHost(int routing_id) const {
}
WebSocketHostState WebSocketDispatcherHost::SendOrDrop(IPC::Message* message) {
+ const uint32 message_type = message->type();
+ const int32 message_routing_id = message->routing_id();
if (!Send(message)) {
- DVLOG(1) << "Sending of message type " << message->type()
+ message = NULL;
+ DVLOG(1) << "Sending of message type " << message_type
<< " failed. Dropping channel.";
- DeleteWebSocketHost(message->routing_id());
+ DeleteWebSocketHost(message_routing_id);
return WEBSOCKET_HOST_DELETED;
}
return WEBSOCKET_HOST_ALIVE;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698