Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traversal: push element to the stack as soon as possible #254

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions libsqsh/src/tree/traversal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions test/fuzzer/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
fuzzer_repro = files(
'crash-148c92a263a7778ab27cc68ddfe0bd5c1880bb80',
'crash-cabfb77fc6783dc1021720ca328e923aa2cc834b',
'crash_0c006fc7bbbab8ba82abca1f01cc1f95714aaf98',
'crash_0f300b1e2028a520e74e06b9d598b97d15b34062',
Expand Down
Loading