1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

fuzz: Ignore encodings when fuzzing on Apple

Not long ago, Apple decided to replace GNU libiconv with a patched up
version of FreeBSD's iconv implementation in their operating systems.
Unfortunately, the quality of both the original implementation as well
as Apple's patches is so abysmal that you routinely find issues when
fuzzing your own code.
This commit is contained in:
Nick Wellnhofer
2025-02-01 22:41:53 +01:00
parent 68be036f29
commit 8d7e38d536

View File

@@ -3981,11 +3981,25 @@ failed:
atts[nbatts] = NULL;
atts[nbatts + 1] = NULL;
/*
* Apple's new libiconv is so broken that you routinely run into
* issues when fuzz testing (by accident with an uninstrumented
* libiconv). Here's a harmless (?) example:
*
* printf '>' | iconv -f shift_jis -t utf-8 | hexdump -C
* printf '\xfc\x00\x00' | iconv -f shift_jis -t utf-8 | hexdump -C
* printf '>\xfc\x00\x00' | iconv -f shift_jis -t utf-8 | hexdump -C
*
* The last command fails to detect the illegal sequence.
*/
#if !defined(__APPLE__) || \
!defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
/*
* Handle specific association to the META tag
*/
if (meta)
htmlCheckMeta(ctxt, atts);
#endif
}
/*