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

regexec.c - harden internals against missing logical_nparens #20727

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

demerphq
Copy link
Collaborator

@demerphq demerphq commented Jan 19, 2023

We can default a 0 rx->logical_nparens to rx->nparens. If rx->logical_nparens is zero then either rx->nparens is also zero, or it can be defaulted. This will fix most re::engine::XXX modules that do not know about the new field, provided they zero the rx structure during construction. If they don't then this patch won't hurt anything and we will have to patch them directly.

Also mark re_op_compile() as available to extensions. Marking it as hidden means that re::engine::PCRE2 and others cannot build.

This patch should go a long way towards fixing issue #20710.
See also: rurban/re-engine-PCRE2#39

We can default a 0 rx->logical_nparens to rx->nparens. If rx->logical_nparens
is zero then either rx->nparens is also zero, or it can be defaulted. This
will fix most re::engine::XXX modules that do not know about the new field,
provided they zero the rx structure during construction. If they don't then
this patch won't hurt anything and we will have to patch them directly.

Also mark re_op_compile() as available to extensions. Marking it as hidden
means that re::engine::PCRE2 and others cannot build.

This patch should go a long way towards fixing issue #20710.
@demerphq demerphq merged commit e6f89d6 into blead Jan 20, 2023
@demerphq demerphq deleted the yves/re_engine_ecosystem_fixups branch January 20, 2023 01:16
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.

None yet

2 participants