Skip to content

Commit

Permalink
Merge pull request #254 from Gottox/fix/arm-fuzzer-crash
Browse files Browse the repository at this point in the history
traversal: push element to the stack as soon as possible
  • Loading branch information
Gottox authored Jun 2, 2024
2 parents 8131bea + 09b9579 commit de79964
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit de79964

Please sign in to comment.