diff --git a/pem_cert/target.c b/pem_cert/target.c index 916f372..c514fda 100644 --- a/pem_cert/target.c +++ b/pem_cert/target.c @@ -25,6 +25,8 @@ #include #include +#define WC_MAX_FUZZ_INPUT_SZ 25000 + /* testing wolfSSL_CTX_use_certificate_buffer with PEM as the filetype*/ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t sz) @@ -32,6 +34,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t sz) WOLFSSL_CTX *ctx; int ret; + /* avoid 25s timeout with parsing large files */ + if (sz > WS_MAX_FUZZ_INPUT_SZ) { + return 0; + } + wolfSSL_Init(); ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());