This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #123843] fix SEGV reading data->flags
[perl5.git] / regcomp.c
index 767f497..51c778d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4386,7 +4386,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                     ( flags & SCF_IN_DEFINE )
                     ||
                     (
-                        (is_inf_internal || is_inf || data->flags & SF_IS_INF)
+                        (is_inf_internal || is_inf || (data && data->flags & SF_IS_INF))
                         &&
                         ( (flags & (SCF_DO_STCLASS | SCF_DO_SUBSTR)) == 0 )
                     )