Making sure bytes are masked when doing int operations.

This commit is contained in:
Simone Bordet 2012-04-02 10:07:25 +02:00
parent 830557f018
commit fff059f7a9
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public class SettingsGenerator extends ControlFrameGenerator
case SPDY.V2:
{
// In v2 the format is 24 bits of ID + 8 bits of flag
int idAndFlags = (id << 8) + flags;
int idAndFlags = (id << 8) + (flags & 0xFF);
// A bug in the Chromium implementation forces v2 to have
// the 3 ID bytes little endian, so we swap first and third
int result = idAndFlags & 0x00_FF_00_FF;