mirror of
				https://github.com/bellard/quickjs.git
				synced 2025-05-29 01:49:18 +08:00 
			
		
		
		
	Merge pull request #400 from renatahodovan/fix-regexp
Define lre_check_timeout in fuzz_regexp
This commit is contained in:
		
						commit
						bff55250c4
					
				@ -16,6 +16,7 @@
 | 
				
			|||||||
#include "libregexp.h"
 | 
					#include "libregexp.h"
 | 
				
			||||||
#include "quickjs-libc.h"
 | 
					#include "quickjs-libc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int nbinterrupts = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int lre_check_stack_overflow(void *opaque, size_t alloca_size) { return 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);
 | 
					    return realloc(ptr, size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int lre_check_timeout(void *opaque)
 | 
				
			||||||
 | 
					 {
 | 
				
			||||||
 | 
					    nbinterrupts++;
 | 
				
			||||||
 | 
					    return (nbinterrupts > 100);
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 | 
					int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 | 
				
			||||||
    int len, ret, i;
 | 
					    int len, ret, i;
 | 
				
			||||||
    uint8_t *bc;
 | 
					    uint8_t *bc;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user