PCRE2Project / pcre2

PCRE2 development is now based here.
Other
922 stars 194 forks source link

test: avoid Undefined Behaviour because of NULL pointer arithmetic in test17 #312

Closed carenas closed 1 year ago

carenas commented 1 year ago

Not a regression, as it seems to be included with the 10.40 release.

Resolves the following error when building with UBSAN in a recent compiler:

Test 17: JIT-specific features when JIT is available
src/pcre2_jit_match.c:124:25: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/pcre2_jit_match.c:124:25 in 
src/pcre2_jit_match.c:126:25: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/pcre2_jit_match.c:126:25 in