clue · GitHub

This changeset fixes an integer overflow for the TCP/IP chunk size on 32 bit platforms. This does not affect common 64 bit platforms and/or the normal UDP query, so this can be rarely observed in practice.

$ docker run -it --rm yukoff/php-32bit
Interactive shell
php > var_dump(PHP_INT_MAX);
int(2147483647)
php > var_dump((1 << 31));
int(-2147483648)
php > var_dump((1 << 31) - 1);
float(-2147483649)
php > var_dump((int)((1 << 31) - 1));
int(2147483647)

Closes #176
Builds on top of #172, in particular https://github.com/reactphp/dns/pull/172/files#diff-cde9e8c539defb086472120d9570d3cb4ca4f02924bd010e8bfce932079a5ddaR188

Read the original on github.com ↗