mirror of
https://github.com/janet-lang/janet
synced 2025-09-07 13:28:03 +00:00
Make janet_equals and janet_compare non recursive
This makes these operatios use constant stack space rather than linear stackspace given the size of the inputs. This is important to prevent certain parser input from causing a stack overflow - in general, we try to avoid unbounded recursion.
This commit is contained in:
@@ -10,9 +10,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
/* fuzz the parser */
|
||||
JanetParser parser;
|
||||
janet_parser_init(&parser);
|
||||
for (int i=0, done = 0; i < size; i++)
|
||||
{
|
||||
switch (janet_parser_status(&parser)) {
|
||||
for (int i = 0, done = 0; i < size; i++) {
|
||||
switch (janet_parser_status(&parser)) {
|
||||
case JANET_PARSE_DEAD:
|
||||
case JANET_PARSE_ERROR:
|
||||
done = 1;
|
||||
|
Reference in New Issue
Block a user