mirror of https://github.com/openssl/openssl.git
bndiv fuzzer: limit the size of the input to avoid timeout
CLA: trivial Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4119)
This commit is contained in:
parent
64bf10167b
commit
61389f0981
|
@ -18,6 +18,9 @@
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include "fuzzer.h"
|
#include "fuzzer.h"
|
||||||
|
|
||||||
|
/* 256 kB */
|
||||||
|
#define MAX_LEN (256 * 1000)
|
||||||
|
|
||||||
static BN_CTX *ctx;
|
static BN_CTX *ctx;
|
||||||
static BIGNUM *b1;
|
static BIGNUM *b1;
|
||||||
static BIGNUM *b2;
|
static BIGNUM *b2;
|
||||||
|
@ -47,6 +50,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
|
||||||
/* s1 and s2 will be the signs for b1 and b2. */
|
/* s1 and s2 will be the signs for b1 and b2. */
|
||||||
int s1 = 0, s2 = 0;
|
int s1 = 0, s2 = 0;
|
||||||
|
|
||||||
|
/* limit the size of the input to avoid timeout */
|
||||||
|
if (len > MAX_LEN)
|
||||||
|
len = MAX_LEN;
|
||||||
|
|
||||||
/* We are going to split the buffer in two, sizes l1 and l2, giving b1 and
|
/* We are going to split the buffer in two, sizes l1 and l2, giving b1 and
|
||||||
* b2.
|
* b2.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue