Fix large signed varint/negative number CPU leak

This commit is contained in:
Dylan K. Taylor 2016-10-20 22:04:47 +01:00
parent b1df4728d3
commit 750462aa75

View File

@ -481,7 +481,7 @@ class Binary{
$w = $v | 0x80; $w = $v | 0x80;
} }
$buf .= self::writeByte($w); $buf .= self::writeByte($w);
$v >>= 7; $v = (($v >> 7) & (PHP_INT_MAX >> 6)); //PHP really needs a logical right-shift operator
}while($v); }while($v);
return $buf; return $buf;