Skip to content

Commit

Permalink
Fix invalid window setting check on 32 bit
Browse files Browse the repository at this point in the history
1 << 31 overflows to a negative number on 32 bit, so the check will always fail.
  • Loading branch information
trowski committed Mar 2, 2020
1 parent 5e75761 commit 4a2e870
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Driver/Http2Driver.php
Expand Up @@ -1192,7 +1192,7 @@ public function handleSettings(array $settings): void
foreach ($settings as $key => $value) {
switch ($key) {
case Http2Parser::INITIAL_WINDOW_SIZE:
if ($value >= 1 << 31) {
if ($value > 2147483647) { // (1 << 31) - 1
throw new Http2ConnectionException("Invalid window size", Http2Parser::FLOW_CONTROL_ERROR);
}

Expand Down

0 comments on commit 4a2e870

Please sign in to comment.