mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 22:19:10 +00:00
redbean: fix restricted websockets opcode checks
This commit is contained in:
parent
c6002e00fb
commit
4a10293f84
1 changed files with 4 additions and 4 deletions
|
@ -5229,12 +5229,12 @@ static int LuaWSRead(lua_State *L) {
|
||||||
|
|
||||||
// reserved bit set
|
// reserved bit set
|
||||||
if (header[0] & 0x70) goto close;
|
if (header[0] & 0x70) goto close;
|
||||||
// reserved opcode
|
|
||||||
if ((header[0] & 0x7) > 0x3) goto close;
|
|
||||||
// payload data is unmasked
|
|
||||||
if (!(header[1] | (1 << 7))) goto close;
|
|
||||||
|
|
||||||
opcode = header[0] & 0xF;
|
opcode = header[0] & 0xF;
|
||||||
|
// reserved opcode
|
||||||
|
if ((opcode & 0x7) >= 0x3 || opcode > 0xA) goto close;
|
||||||
|
// payload data is unmasked
|
||||||
|
if (!(header[1] | (1 << 7))) goto close;
|
||||||
// not in continuation
|
// not in continuation
|
||||||
if (!wsfragtype && !opcode) goto close;
|
if (!wsfragtype && !opcode) goto close;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue