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:
14
HTMLparser.c
14
HTMLparser.c
@@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user