Skip to content

Commit f2411ac

Browse files
authored
jit: fail early in ffcps_* if subject shorter than offs1 (#175)
FF_FUN would try loading a vector from an invalid address triggering a crash. Add the same check that is done in the x86/s390x implementations and that was missing from the original code. Fixes: #86
1 parent fb23bb1 commit f2411ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pcre2_jit_neon_inc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ restart:;
183183
#endif
184184

185185
#if defined(FFCPS)
186+
if (str_ptr >= str_end)
187+
return NULL;
186188
sljit_u8 *p1 = str_ptr - diff;
187189
#endif
188190
sljit_s32 align_offset = ((uint64_t)str_ptr & 0xf);

0 commit comments

Comments
 (0)