mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 742614: Allocation of string is not checked in WebSockets text frame parsing. r=bsmith
This commit is contained in:
parent
f8c10a1c5b
commit
f7e8936e78
@ -1050,7 +1050,10 @@ WebSocketChannel::ProcessInput(PRUint8 *buffer, PRUint32 count)
|
||||
} else if (opcode == kText) {
|
||||
LOG(("WebSocketChannel:: text frame received\n"));
|
||||
if (mListener) {
|
||||
nsCString utf8Data((const char *)payload, payloadLength);
|
||||
nsCString utf8Data;
|
||||
if (!utf8Data.Assign((const char *)payload, payloadLength,
|
||||
mozilla::fallible_t()))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// Section 8.1 says to fail connection if invalid utf-8 in text message
|
||||
if (!IsUTF8(utf8Data, false)) {
|
||||
|
Loading…
Reference in New Issue
Block a user