Merge pull request #400 from renatahodovan/fix-regexp

Define lre_check_timeout in fuzz_regexp
This commit is contained in:
bellard 2025-04-14 17:54:18 +02:00 committed by GitHub
commit bff55250c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@
#include "libregexp.h"
#include "quickjs-libc.h"
static int nbinterrupts = 0;
int lre_check_stack_overflow(void *opaque, size_t alloca_size) { return 0; }
@ -24,6 +25,12 @@ void *lre_realloc(void *opaque, void *ptr, size_t size)
return realloc(ptr, size);
}
int lre_check_timeout(void *opaque)
{
nbinterrupts++;
return (nbinterrupts > 100);
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int len, ret, i;
uint8_t *bc;