summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <meissner@suse.de>2020-02-10 13:40:48 +0100
committerMarcus Meissner <meissner@suse.de>2020-02-10 13:40:48 +0100
commitfe42811465f43b99dfc454f261e1ef06838d0659 (patch)
tree0d0e80a23d97c1bc605e22453ed576c46231e400
parent67d70968bef66b7fc9d614cd4e361ea9b2e7eed1 (diff)
downloadlibgphoto2-fe42811465f43b99dfc454f261e1ef06838d0659.tar.gz
do not sleep during fuzzing (AFL)
-rw-r--r--camlibs/enigma13/enigma13.c5
-rw-r--r--camlibs/gsmart300/gsmart300.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/camlibs/enigma13/enigma13.c b/camlibs/enigma13/enigma13.c
index 7dbf7b6d1..da01ef463 100644
--- a/camlibs/enigma13/enigma13.c
+++ b/camlibs/enigma13/enigma13.c
@@ -30,6 +30,11 @@
#include <gphoto2/gphoto2-result.h>
#include "gphoto2-endian.h"
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+#define sleep(x)
+#define usleep(x)
+#endif
+
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
diff --git a/camlibs/gsmart300/gsmart300.c b/camlibs/gsmart300/gsmart300.c
index 11f7410fa..c3709a31e 100644
--- a/camlibs/gsmart300/gsmart300.c
+++ b/camlibs/gsmart300/gsmart300.c
@@ -57,6 +57,10 @@
# define N_(String) (String)
#endif
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+#define sleep(x)
+#endif
+
#define GP_MODULE "gsmart300"
static int gsmart300_download_data (CameraPrivateLibrary * lib,
int data_type, uint16_t index, unsigned int size,