diff --git a/libsqsh/src/tree/traversal.c b/libsqsh/src/tree/traversal.c index 922c2926..70076821 100644 --- a/libsqsh/src/tree/traversal.c +++ b/libsqsh/src/tree/traversal.c @@ -75,6 +75,8 @@ push_stack(struct SqshTreeTraversal *traversal) { rv = -SQSH_ERROR_MALLOC_FAILED; goto out; } + element->next = traversal->stack; + traversal->stack = element; struct SqshArchive *archive = traversal->base_file->archive; const uint32_t dir_inode = sqsh_file_inode(traversal->current_file); @@ -88,9 +90,6 @@ push_stack(struct SqshTreeTraversal *traversal) { if (rv < 0) { goto out; } - element->next = traversal->stack; - traversal->stack = element; - traversal->current_file = &element->file; traversal->state = SQSH_TREE_TRAVERSAL_STATE_DIRECTORY_BEGIN; out: diff --git a/test/fuzzer/crash-148c92a263a7778ab27cc68ddfe0bd5c1880bb80 b/test/fuzzer/crash-148c92a263a7778ab27cc68ddfe0bd5c1880bb80 new file mode 100644 index 00000000..df5ed316 Binary files /dev/null and b/test/fuzzer/crash-148c92a263a7778ab27cc68ddfe0bd5c1880bb80 differ diff --git a/test/fuzzer/meson.build b/test/fuzzer/meson.build index 0af5c7b4..03d11426 100644 --- a/test/fuzzer/meson.build +++ b/test/fuzzer/meson.build @@ -1,4 +1,5 @@ fuzzer_repro = files( + 'crash-148c92a263a7778ab27cc68ddfe0bd5c1880bb80', 'crash-cabfb77fc6783dc1021720ca328e923aa2cc834b', 'crash_0c006fc7bbbab8ba82abca1f01cc1f95714aaf98', 'crash_0f300b1e2028a520e74e06b9d598b97d15b34062',