[php-src] Issue #9212: PcgOneseq128XslRr64::jump should not allow negative $advance
| From: | arokettu | Date: | Sun, 31 Jul 2022 20:56:07 +0000 |
| Subject: | [php-src] Issue #9212: PcgOneseq128XslRr64::jump should not allow negative $advance | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242090@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9212
Author: arokettu
### Description
As discussed in internals: https://externals.io/message/118328
The following code:
```php
<?php
$engine = new \Random\Engine\PcgOneseq128XslRr64();
$engine->advance(-1);
```
advances the engine 2**64 - 1 steps due to unsigned int cast but it should throw a ValueError
instead
### PHP Version
PHP 8.2.0 beta 1
### Operating System
_No response_