Skip to content

Commit a5f6cc6

Browse files
committed
fix(32bit): use PHP_INT_MAX where needed
* Typo from #52392 `0xFFFF` is only 2 bytes, but we need either `0xFFFFFFFF` or maybe a bit easier to read `PHP_INT_MAX`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 94538c1 commit a5f6cc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Security/Normalizer/IpAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private function getIPv6Subnet(string $ip): string {
4343
$maskSize = max(32, $maskSize);
4444
if (PHP_INT_SIZE === 4) {
4545
// as long as we support 32bit PHP we cannot use the `P` pack formatter (and not overflow 32bit integer)
46-
$mask = pack('VVVV', 0xFFFF, $maskSize === 64 ? 0xFFFF : ((1 << $maskSize - 32) - 1), 0, 0);
46+
$mask = pack('VVVV', PHP_INT_MAX, $maskSize >= 64 ? PHP_INT_MAX : ((1 << $maskSize - 32) - 1), 0, 0);
4747
} else {
4848
$mask = pack('VVP', (1 << 32) - 1, (1 << $maskSize - 32) - 1, 0);
4949
}

0 commit comments

Comments
 (0)