Skip to content

JIT/non-JIT match difference with *+ repeated groups #324

@addisoncrump

Description

@addisoncrump

Discovered with #322.

The regex (A)*+, with A as any literal, does not have consistent matches between JIT and non-JIT when used with endanchored.

sh-5.2$ xxd endanchored_crash 
00000000: 0000 0000 0000 0020 2841 292a 2b         ....... (A)*+
sh-5.2$ ./pcre2_fuzzer endanchored_crash
Encountered failure while performing match errorcode comparison; context:
Pattern/sample string (hex encoded): 2841292a2b
Compile options 20100000 never_backslash_c,endanchored
Match options 00002000
Non-JIT'd operation did not emit an error.
1 matches discovered by non-JIT'd regex:
Match 0 (hex encoded): 

JIT'd operation did not emit an error.
2 matches discovered by JIT'd regex:
Match 0 (hex encoded): 
Match 1 (hex encoded): 41

Disabling endanchored causes the difference to disappear. I'm not sure what the correct behaviour should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions