mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 663893 - Avoid null dereferences in websocket handler. r=mcmanus
This commit is contained in:
parent
7c55737ac3
commit
c0c46e51bd
@ -865,9 +865,11 @@ nsWebSocketHandler::ProcessInput(PRUint8 *buffer, PRUint32 count)
|
||||
mCloseTimer->Cancel();
|
||||
mCloseTimer = nsnull;
|
||||
}
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new CallOnServerClose(mListener, mContext);
|
||||
NS_DispatchToMainThread(event);
|
||||
if (mListener) {
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new CallOnServerClose(mListener, mContext);
|
||||
NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
||||
if (mClientClosed)
|
||||
ReleaseSession();
|
||||
@ -1314,9 +1316,11 @@ nsWebSocketHandler::StopSession(nsresult reason)
|
||||
|
||||
if (!mCalledOnStop) {
|
||||
mCalledOnStop = 1;
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new CallOnStop(mListener, mContext, reason);
|
||||
NS_DispatchToMainThread(event);
|
||||
if (mListener) {
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new CallOnStop(mListener, mContext, reason);
|
||||
NS_DispatchToMainThread(event);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user