Bug 886417: lock before accessing DataChannel->mState r=mcmanus

This commit is contained in:
Randell Jesup 2013-06-28 17:56:45 -04:00
parent 87f416aced
commit 7d6ec9b36f

View File

@ -405,13 +405,15 @@ public:
// Find out state
uint16_t GetReadyState()
{
if (mState == WAITING_TO_OPEN)
return CONNECTING;
return mState;
if (mConnection) {
MutexAutoLock lock(mConnection->mLock);
if (mState == WAITING_TO_OPEN)
return CONNECTING;
return mState;
}
return CLOSED;
}
void SetReadyState(uint16_t aState) { mState = aState; }
void GetLabel(nsAString& aLabel) { CopyUTF8toUTF16(mLabel, aLabel); }
void GetProtocol(nsAString& aProtocol) { CopyUTF8toUTF16(mProtocol, aProtocol); }
uint16_t GetStream() { return mStream; }