diff --git a/pcre2/src/pcre2test.c b/pcre2/src/pcre2test.c index ea52a204bcad81e55efbd0cc3ebf6514bea0793b..378529a6236d004d8c24c86946469a5234434e83 100644 --- a/pcre2/src/pcre2test.c +++ b/pcre2/src/pcre2test.c @@ -6781,9 +6781,9 @@ while ((c = *p++) != 0) } i = (int32_t)li; - if (i-- == 0) + if (i-- <= 0) { - fprintf(outfile, "** Zero repeat not allowed\n"); + fprintf(outfile, "** Zero or negative repeat not allowed\n"); return PR_OK; } diff --git a/pcre2/testdata/testinput2 b/pcre2/testdata/testinput2 index d37d8f30efaeb6bb10bac82f4f186dcac971f55f..717ba2ae5da3ab1355fea584f2fad442b4137b1f 100644 --- a/pcre2/testdata/testinput2 +++ b/pcre2/testdata/testinput2 @@ -5932,4 +5932,7 @@ a)"xI /[Aa]{2,3}/BI aabcd +-- + \[X]{-10} + # End of testinput2 diff --git a/pcre2/testdata/testoutput2 b/pcre2/testdata/testoutput2 index ce090f8c1b100faf15f802924e0c0b00e19c3895..d2188d3c917ed51381fcb217c0499ba402eac850 100644 --- a/pcre2/testdata/testoutput2 +++ b/pcre2/testdata/testoutput2 @@ -17746,6 +17746,10 @@ Subject length lower bound = 2 aabcd 0: aa +-- + \[X]{-10} +** Zero or negative repeat not allowed + # End of testinput2 Error -70: PCRE2_ERROR_BADDATA (unknown error number) Error -62: bad serialized data