Fix Perl_av_store off by one error in key comparison

This commit is contained in:
bbrtj 2025-12-14 20:41:28 +01:00 committed by Karl Williamson
parent f2abec8bfa
commit b6e54476dc

2
av.c
View File

@ -361,7 +361,7 @@ Perl_av_store(pTHX_ AV *av, SSize_t key, SV *val)
return NULL; return NULL;
} }
if (SvREADONLY(av) && key >= AvFILL(av)) if (SvREADONLY(av) && key > AvFILL(av))
croak_no_modify(); croak_no_modify();
if (!AvREAL(av) && AvREIFY(av)) if (!AvREAL(av) && AvREIFY(av))