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

no partial match if trailing data is invalid utf #238

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

carenas
Copy link
Contributor

@carenas carenas commented Apr 20, 2023

Addresses the inconsistency raised by the failing tests in #237 as shown by:

PCRE2 version 10.34 2019-11-21
  re> /.a/match_invalid_utf,allvector,jit
data> b\xb1\=ph,ovector=1
No match
 0: <unchanged>
data> b\xb1\=ph,ovector=1,no_jit
Partial match: b\x{b1}
** ovector[1] is not equal to the subject length: 1 != 2
 0: 0 1

Avoid returning a partial match if one was found but followed by invalid
UTF, making the result consistent with JIT and unlike:

  PCRE2 version 10.34 2019-11-21
    re> /.a/match_invalid_utf,allvector,jit
  data> b\xb1\=ph,ovector=1
  No match
   0: <unchanged>
  data> b\xb1\=ph,ovector=1,no_jit
  Partial match: b\x{b1}
  ** ovector[1] is not equal to the subject length: 1 != 2
   0: 0 1
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.

2 participants