This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't call Perl_fbm_instr() with negative length
[perl5.git] / util.c
diff --git a/util.c b/util.c
index 6bc2fe5..584d2b8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -816,6 +816,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U
 
     PERL_ARGS_ASSERT_FBM_INSTR;
 
+    assert(bigend >= big);
+
     if ((STRLEN)(bigend - big) < littlelen) {
        if (     tail
             && ((STRLEN)(bigend - big) == littlelen - 1)