Skip to content

Commit 1e1c55f

Browse files
fix: V-002 security vulnerability
Initialize dfa_transitions = NULL before generate_transitions() so that the cleanup check in regex_compile() is never reading an uninitialized pointer when the overflow guard returns early. Fixes -Werror=maybe-uninitialized on aarch64 GCC 13. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ea5e749 commit 1e1c55f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

regex_src/regexJIT.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,7 @@ struct regex_machine* regex_compile(const regex_char_t *regex_string, int length
18761876
}
18771877

18781878
/* Step 2: generating branches (Right->Left). */
1879+
compiler_common.dfa_transitions = NULL;
18791880
error_code = generate_transitions(&compiler_common);
18801881
stack_destroy(&compiler_common.stack);
18811882
stack_destroy(&compiler_common.depth);

0 commit comments

Comments
 (0)