diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-30 16:49:19 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-30 16:49:19 +0000 |
commit | 825ec65dd739c6637db382d266fe0f0a292ebc21 (patch) | |
tree | 925df966e75f24244db333a71bb41b61b0699107 | |
parent | 4fd578d0b721e7267bbfad4dd97652687d643d09 (diff) | |
download | pcre-825ec65dd739c6637db382d266fe0f0a292ebc21.tar.gz |
pcretest was not diagnosing characters > 0x7fffffff in 8-bit mode.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1190 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | pcretest.c | 6 | ||||
-rw-r--r-- | testdata/testinput15 | 4 | ||||
-rw-r--r-- | testdata/testoutput15 | 6 |
4 files changed, 25 insertions, 0 deletions
@@ -137,6 +137,15 @@ Version 8.32 provide fast pattern matching, so several sanity checks are not performed. However, feature tests are still performed. The new interface provides 1.4x speedup compared to the old one. + +29. If pcre_exec() or pcre_dfa_exec() was called with a negative value for + the subject string length, the error given was PCRE_ERROR_BADOFFSET, which + was confusing. There is now a new error PCRE_ERROR_BADLENGTH for this case. + +30. In 8-bit UTF-8 mode, pcretest failed to give an error for data codepoints + greater than 0x7fffffff (which cannot be represented in UTF-8, even under + the "old" RFC 2279). Instead, it ended up passing a negative length to + pcre_exec(). Version 8.31 06-July-2012 @@ -4730,6 +4730,12 @@ while (!done) #ifndef NOUTF if (use_utf) { + if (c > 0x7fffffff) + { + fprintf(outfile, "** Character \\x{%x} is greater than 0x7fffffff " + "and so cannot be converted to UTF-8\n", c); + goto NEXT_DATA; + } q8 += ord2utf8(c, q8); } else diff --git a/testdata/testinput15 b/testdata/testinput15 index c55f3a5..8753e5e 100644 --- a/testdata/testinput15 +++ b/testdata/testinput15 @@ -423,4 +423,8 @@ correctly, but that messes up comparisons). --/ /\x{a0}+\s!/8BZT1 \x{a0}\x20! +/A/8 + \x{ff000041} + \x{7f000041} + /-- End of testinput15 --/ diff --git a/testdata/testoutput15 b/testdata/testoutput15 index 9c99da2..b9d5aa2 100644 --- a/testdata/testoutput15 +++ b/testdata/testoutput15 @@ -1260,4 +1260,10 @@ Need char = \x{bf} \x{a0}\x20! 0: \x{a0} ! +/A/8 + \x{ff000041} +** Character \x{ff000041} is greater than 0x7fffffff and so cannot be converted to UTF-8 + \x{7f000041} +Error -10 (bad UTF-8 string) offset=0 reason=12 + /-- End of testinput15 --/ |