[libxml2] Disable hash randomization when fuzzing
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Disable hash randomization when fuzzing
- Date: Mon, 15 Apr 2019 12:24:29 +0000 (UTC)
commit fa3166c227f0095204521672b8ce4770dafd0035
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Fri Apr 12 12:03:04 2019 +0200
Disable hash randomization when fuzzing
Use the FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION macro proposed by
libFuzzer.
dict.c | 3 ++-
hash.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/dict.c b/dict.c
index 0ef3718d..14fe398e 100644
--- a/dict.c
+++ b/dict.c
@@ -38,7 +38,8 @@
* list we will use the BigKey algo as soon as the hash size grows
* over MIN_DICT_SIZE so this actually works
*/
-#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
+#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \
+ !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
#define DICT_RANDOMIZATION
#endif
diff --git a/hash.c b/hash.c
index b0b4abc9..1145cb93 100644
--- a/hash.c
+++ b/hash.c
@@ -33,7 +33,8 @@
* it seems that having hash randomization might be a good idea
* when using XML with untrusted data
*/
-#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
+#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \
+ !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
#define HASH_RANDOMIZATION
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]