php-src/ext
Tim Düsterhus 64d9080534
random: Fix off-by-one in fast path selection of Randomizer::getBytesFromString() (#10449)
With a single byte we can choose offsets between 0x00 and 0xff, thus 0x100
different offsets. We only need to use the slow path for sources of more than
0x100 bytes.

The previous version was correct with regard to the output expectations, it was
just slower than necessary. Better fix this now while we still can before being
bound by our BC guarantees with regard to emitted sequences.

This also adds a test to verify the behavior: For powers of two we never reject
any values during rejection sampling, we just need to mask off the unneeded
bits. Thus we can specifically verify that the number of calls to the engine
match the expected amount. We also verify that all the possible values are
emitted to make sure the masking does not remove any required bits. For inputs
longer than 0x100 bytes we need trust the `range()` implementation to be
unbiased, but still verify the number of engine calls and perform a basic
output check.
2023-01-26 23:28:34 +01:00
..
bcmath
bz2 Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
calendar Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
com_dotnet Remove unnecessary usage of CONST_CS 2022-11-28 17:12:07 +01:00
ctype Merge branch 'PHP-8.1' into PHP-8.2 2022-10-27 14:42:17 +01:00
curl Do not use zend_fcall_info_argn() in ext-curl 2022-10-21 18:31:40 +01:00
date Merge branch 'PHP-8.2' 2023-01-25 10:50:32 +00:00
dba Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
dl_test Merge branch 'PHP-8.2' 2022-09-07 17:41:10 +02:00
dom Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
enchant Revert "Port all internally used classes to use default_object_handlers" 2022-09-14 11:13:23 +02:00
exif Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
ffi Merge branch 'PHP-8.2' 2023-01-24 09:15:44 +03:00
fileinfo Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
filter Merge branch 'PHP-8.2' 2022-10-27 14:42:40 +01:00
ftp Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
gd Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
gettext
gmp Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
hash Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
iconv Mark constant static arrays in function bodies actually as const (#10325) 2023-01-15 14:51:31 +00:00
imap Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
intl Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
json Revert GH-10220 2023-01-16 12:27:33 +01:00
ldap Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
libxml Handle trampolines correctly in new FCC API + usages (#9877) 2022-11-22 17:12:53 +00:00
mbstring Add specialized UTF-8 validation function for hosts with no SSE2/AVX2 support 2023-01-26 20:58:24 +02:00
mysqli Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
mysqlnd Remove mysqlnd_shutdown() (#10355) 2023-01-17 11:46:34 +00:00
oci8 [skip ci] Update year to 2023 (#10374) 2023-01-19 12:01:29 +01:00
odbc Merge branch 'PHP-8.2' 2022-09-06 10:42:34 +01:00
opcache Add missing type guard 2023-01-25 12:10:19 +03:00
openssl Merge branch 'PHP-8.2' 2023-01-23 13:51:26 +00:00
pcntl Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
pcre Remove pcre_get_compiled_regex_ex() (#10354) 2023-01-18 14:28:19 +00:00
pdo Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
pdo_dblib Use php_info_print_table_header for actual column headers only (#9485) 2022-09-06 08:48:22 +02:00
pdo_firebird Merge branch 'PHP-8.2' 2022-11-30 12:13:36 +01:00
pdo_mysql Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
pdo_oci [skip ci] Backport XFAIL of failing test 2022-11-11 19:46:16 +01:00
pdo_odbc Merge branch 'PHP-8.2' 2022-10-19 11:37:30 +02:00
pdo_pgsql Revert GH-10220 2023-01-16 12:27:33 +01:00
pdo_sqlite Merge branch 'PHP-8.2' 2022-12-19 16:17:02 +01:00
pgsql Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
phar [skip ci] Update year to 2023 (#10374) 2023-01-19 12:01:29 +01:00
posix posix detects posix_pathconf api. 2023-01-23 17:49:34 +00:00
pspell Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
random random: Fix off-by-one in fast path selection of Randomizer::getBytesFromString() (#10449) 2023-01-26 23:28:34 +01:00
readline Use php_info_print_table_header for actual column headers only (#9485) 2022-09-06 08:48:22 +02:00
reflection Fix GH-10259 ReflectionClass::getStaticProperties doesn't need null return type (#10418) 2023-01-24 22:26:52 +01:00
session session: Remove PS_EXTRA_RAND_BYTES (#10394) 2023-01-23 14:42:32 +01:00
shmop Revert GH-10220 2023-01-16 12:27:33 +01:00
simplexml Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
skeleton Merge branch 'PHP-8.2' 2022-09-07 17:41:10 +02:00
snmp Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
soap Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
sockets Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
sodium Remove unnecessary usage of CONST_CS 2022-11-28 17:12:07 +01:00
spl Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
sqlite3 Merge branch 'PHP-8.2' 2023-01-19 09:06:39 +01:00
standard Merge branch 'PHP-8.2' 2023-01-25 00:12:32 +00:00
sysvmsg Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
sysvsem Revert "Port all internally used classes to use default_object_handlers" 2022-09-14 11:13:23 +02:00
sysvshm Revert "Port all internally used classes to use default_object_handlers" 2022-09-14 11:13:23 +02:00
tidy Update INI validator and displayers depending on INI type 2022-09-06 10:33:34 +01:00
tokenizer Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
xml Declare XML_SAX_IMPL constant in stubs (#9732) 2022-10-12 11:42:24 +02:00
xmlreader Merge branch 'PHP-8.2' 2022-10-27 14:42:40 +01:00
xmlwriter Merge branch 'PHP-8.2' 2023-01-15 15:43:57 +00:00
xsl Fix bug 69168: DomNode::getNodePath() returns invalid path 2023-01-19 14:06:41 +01:00
zend_test Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
zip Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
zlib Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
ext_skel.php