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

fix: do not store rule object from compiler callback permanently #142

Closed
wants to merge 1 commit into from

Conversation

secDre4mer
Copy link
Contributor

The YR_RULE* pointer from the compiler callback originates from yr_arena_get_ptr, which refers to yr_arena_ref_to_ptr, which has the following comment:

This pointer is valid only until the next call to any of the functions that allocates space in the buffer where the data resides, like yr_arena_allocate_xxx and yr_arena_write_xxx.

Since the compiler may (and is highly likely to) allocate more data in the arena, we can not persistently store this pointer and may only use it during the callback (though this is sadly undocumented).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant