regex: fix OOB bug discovered through ./v -g -force-bounds-checking vlib/regex/ (fix by @penguindark) (#24960)

This commit is contained in:
Delyan Angelov 2025-07-24 08:10:45 +03:00 committed by GitHub
parent 66946738fb
commit 93a1989b0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -353,7 +353,10 @@ pub fn (mut re RE) reset() {
// reset state list
re.state_list.clear()
re.group_stack.clear()
// restore initial state of the stack
for mut x in re.group_stack {
x = -1
}
}
// reset for search mode fail