Commit graph

14 commits

Author SHA1 Message Date
Alex Dowad
175b438abe Fix spurious failures of php-fuzz-mbstring 2023-11-28 21:04:17 +02:00
Alex Dowad
5f2587eb25 php-fuzz-mbstring also tests text encoding validation functions
In 6fc8d014df, pakutoma added specialized validation functions for
ISO-2022-JP, JIS, UTF-7, and UTF7-IMAP text. In the future, it is
possible we might add such functions for more legacy text encodings.
Allowing them to be tested by php-fuzz-mbstring may help to catch
bugs, both now and in the future.
2023-03-27 08:17:49 +02:00
Alex Dowad
d5d9900661 When fuzzing mbstring encoding conversion code, compare output with different intermediate buffer sizes
Currently, php-fuzz-mbstring only confirms that no crashes (including
ASAN violations) occur when converting text from one encoding to
another.

Try performing each conversion operation with two different sizes for
the intermediate buffer which is used to pass data from the decoder to
the encoder. If the encoding conversion code is correct, the size of
that intermediate buffer shouldn't matter; we should always get exactly
the same results.

This is a much stricter test, which is more likely to catch bugs.
2023-02-05 20:04:05 +02:00
Alex Dowad
492021168d php_mb_convert_encoding{,_ex} returns zend_string
That's what all existing callers want anyways. This avoids 2
unnecessary copies of the converted string.
2022-05-28 21:53:39 +02:00
Alex Dowad
0154a5ac9f Use fast text conversion filters to implement php_mb_convert_encoding_ex 2022-05-28 21:53:38 +02:00
Nikita Popov
1584352e19 Add fuzzer for mb_convert_encoding
This uses the php-fuzz-mbstring name, moving the existing fuzzer
to php-fuzz-mbregex.
2022-05-08 22:34:23 +02:00
Nikita Popov
cd4243dde9 Add fuzzer for function JIT
This is a basic fuzzer for the function JIT, which looks for
crashes and sanitizer violations only, and does not try to detect
differing behavior yet.
2021-09-15 17:12:39 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
99a68775bf Fix mbstring fuzzer
mb_ereg can throw now, so we need a dummy frame and need to
free the exception afterwards.
2020-09-11 18:35:16 +02:00
Nikita Popov
7df8f952ae Further reduce parse depth limit in mbstring fuzzer
Depth limit of 1024 still causes optimize_node stack overflows
when running under asan.
2019-12-14 22:43:15 +01:00
Nikita Popov
9de4f87aca Limit parse depth in mbstring fuzzer
The default depth of 4096 is large enough to cause optimize_node
stack overflows under asan. Reduce to 1024.
2019-12-13 16:09:28 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
c4e2ca607f Various improvements to fuzzer SAPIs 2019-09-16 16:04:10 +02:00
Stanislav Malyshev
41f45647f9 Add fuzzer SAPIs to the core 2019-09-16 16:04:09 +02:00