2014-08-26 11:41:31 -04:00
|
|
|
Change Log for PCRE2
|
|
|
|
--------------------
|
|
|
|
|
2015-03-11 13:44:16 -04:00
|
|
|
Version 10.20 xx-xx-2015
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
1. Callouts with string arguments have been added.
|
|
|
|
|
2015-03-12 07:49:29 -04:00
|
|
|
2. Assertion code generator in JIT has been optimized.
|
|
|
|
|
2015-03-20 08:37:28 -04:00
|
|
|
3. The invalid pattern (?(?C) has a missing assertion condition at the end. The
|
|
|
|
pcre2_compile() function read past the end of the input before diagnosing an
|
2015-03-23 11:52:08 -04:00
|
|
|
error. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
|
|
|
4. Implemented pcre2_callout_enumerate().
|
2015-03-20 08:37:28 -04:00
|
|
|
|
2015-03-24 06:21:34 -04:00
|
|
|
5. Fix JIT compilation of conditional blocks whose assertion is converted to
|
|
|
|
(*FAIL). E.g: /(?(?!))/.
|
|
|
|
|
|
|
|
6. The pattern /(?(?!)^)/ caused references to random memory. This bug was
|
|
|
|
discovered by the LLVM fuzzer.
|
|
|
|
|
|
|
|
7. The assertion (?!) is optimized to (*FAIL). This was not handled correctly
|
|
|
|
when this assertion was used as a condition, for example (?(?!)a|b). In
|
|
|
|
pcre2_match() it worked by luck; in pcre2_dfa_match() it gave an incorrect
|
|
|
|
error about an unsupported item.
|
2015-03-24 04:43:52 -04:00
|
|
|
|
2015-03-11 13:44:16 -04:00
|
|
|
|
2015-03-06 10:08:29 -05:00
|
|
|
Version 10.10 06-March-2015
|
|
|
|
---------------------------
|
2015-01-13 11:01:24 -05:00
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
1. When a pattern is compiled, it remembers the highest back reference so that
|
|
|
|
when matching, if the ovector is too small, extra memory can be obtained to
|
2015-01-13 11:01:24 -05:00
|
|
|
use instead. A conditional subpattern whose condition is a check on a capture
|
|
|
|
having happened, such as, for example in the pattern /^(?:(a)|b)(?(1)A|B)/, is
|
|
|
|
another kind of back reference, but it was not setting the highest
|
|
|
|
backreference number. This mattered only if pcre2_match() was called with an
|
|
|
|
ovector that was too small to hold the capture, and there was no other kind of
|
|
|
|
back reference (a situation which is probably quite rare). The effect of the
|
|
|
|
bug was that the condition was always treated as FALSE when the capture could
|
|
|
|
not be consulted, leading to a incorrect behaviour by pcre2_match(). This bug
|
|
|
|
has been fixed.
|
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
2. Functions for serialization and deserialization of sets of compiled patterns
|
|
|
|
have been added.
|
|
|
|
|
|
|
|
3. The value that is returned by PCRE2_INFO_SIZE has been corrected to remove
|
|
|
|
excess code units at the end of the data block that may occasionally occur if
|
|
|
|
the code for calculating the size over-estimates. This change stops the
|
|
|
|
serialization code copying uninitialized data, to which valgrind objects. The
|
|
|
|
documentation of PCRE2_INFO_SIZE was incorrect in stating that the size did not
|
|
|
|
include the general overhead. This has been corrected.
|
|
|
|
|
|
|
|
4. All code units in every slot in the table of group names are now set, again
|
|
|
|
in order to avoid accessing uninitialized data when serializing.
|
|
|
|
|
2015-01-26 09:57:27 -05:00
|
|
|
5. The (*NO_JIT) feature is implemented.
|
|
|
|
|
2015-01-27 12:21:32 -05:00
|
|
|
6. If a bug that caused pcre2_compile() to use more memory than allocated was
|
2015-02-20 06:20:40 -05:00
|
|
|
triggered when using valgrind, the code in (3) above passed a stupidly large
|
2015-01-27 12:21:32 -05:00
|
|
|
value to valgrind. This caused a crash instead of an "internal error" return.
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
7. A reference to a duplicated named group (either a back reference or a test
|
|
|
|
for being set in a conditional) that occurred in a part of the pattern where
|
|
|
|
PCRE2_DUPNAMES was not set caused the amount of memory needed for the pattern
|
2015-01-27 12:21:32 -05:00
|
|
|
to be incorrectly calculated, leading to overwriting.
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
8. A mutually recursive set of back references such as (\2)(\1) caused a
|
|
|
|
segfault at compile time (while trying to find the minimum matching length).
|
2015-01-28 06:28:53 -05:00
|
|
|
The infinite loop is now broken (with the minimum length unset, that is, zero).
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
9. If an assertion that was used as a condition was quantified with a minimum
|
|
|
|
of zero, matching went wrong. In particular, if the whole group had unlimited
|
2015-01-28 12:31:11 -05:00
|
|
|
repetition and could match an empty string, a segfault was likely. The pattern
|
|
|
|
(?(?=0)?)+ is an example that caused this. Perl allows assertions to be
|
|
|
|
quantified, but not if they are being used as conditions, so the above pattern
|
|
|
|
is faulted by Perl. PCRE2 has now been changed so that it also rejects such
|
|
|
|
patterns.
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
10. The error message for an invalid quantifier has been changed from "nothing
|
2015-01-28 12:31:11 -05:00
|
|
|
to repeat" to "quantifier does not follow a repeatable item".
|
|
|
|
|
2015-02-06 11:47:15 -05:00
|
|
|
11. If a bad UTF string is compiled with NO_UTF_CHECK, it may succeed, but
|
|
|
|
scanning the compiled pattern in subsequent auto-possessification can get out
|
|
|
|
of step and lead to an unknown opcode. Previously this could have caused an
|
|
|
|
infinite loop. Now it generates an "internal error" error. This is a tidyup,
|
|
|
|
not a bug fix; passing bad UTF with NO_UTF_CHECK is documented as having an
|
|
|
|
undefined outcome.
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
12. A UTF pattern containing a "not" match of a non-ASCII character and a
|
2015-02-06 12:51:55 -05:00
|
|
|
subroutine reference could loop at compile time. Example: /[^\xff]((?1))/.
|
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
13. The locale test (RunTest 3) has been upgraded. It now checks that a locale
|
|
|
|
that is found in the output of "locale -a" can actually be set by pcre2test
|
|
|
|
before it is accepted. Previously, in an environment where a locale was listed
|
|
|
|
but would not set (an example does exist), the test would "pass" without
|
|
|
|
actually doing anything. Also the fr_CA locale has been added to the list of
|
2015-02-07 12:45:55 -05:00
|
|
|
locales that can be used.
|
|
|
|
|
2015-02-10 07:48:45 -05:00
|
|
|
14. Fixed a bug in pcre2_substitute(). If a replacement string ended in a
|
|
|
|
capturing group number without parentheses, the last character was incorrectly
|
|
|
|
literally included at the end of the replacement string.
|
|
|
|
|
2015-02-11 05:06:09 -05:00
|
|
|
15. A possessive capturing group such as (a)*+ with a minimum repeat of zero
|
2015-02-20 06:20:40 -05:00
|
|
|
failed to allow the zero-repeat case if pcre2_match() was called with an
|
2015-02-11 05:06:09 -05:00
|
|
|
ovector too small to capture the group.
|
|
|
|
|
2015-02-21 13:53:51 -05:00
|
|
|
16. Improved error message in pcre2test when setting the stack size (-S) fails.
|
|
|
|
|
2015-02-26 12:36:29 -05:00
|
|
|
17. Fixed two bugs in CMakeLists.txt: (1) Some lines had got lost in the
|
|
|
|
transfer from PCRE1, meaning that CMake configuration failed if "build tests"
|
|
|
|
was selected. (2) The file src/pcre2_serialize.c had not been added to the list
|
2015-02-24 07:35:28 -05:00
|
|
|
of PCRE2 sources, which caused a failure to build pcre2test.
|
|
|
|
|
2015-02-26 12:36:29 -05:00
|
|
|
18. Fixed typo in pcre2_serialize.c (DECL instead of DEFN) that causes problems
|
2015-02-24 09:21:28 -05:00
|
|
|
only on Windows.
|
|
|
|
|
2015-02-25 12:19:28 -05:00
|
|
|
19. Use binary input when reading back saved serialized patterns in pcre2test.
|
|
|
|
|
|
|
|
20. Added RunTest.bat for running the tests under Windows.
|
|
|
|
|
2015-03-06 10:08:29 -05:00
|
|
|
21. "make distclean" was not removing config.h, a file that may be created for
|
|
|
|
use with CMake.
|
2015-02-26 12:20:48 -05:00
|
|
|
|
2015-02-28 06:31:51 -05:00
|
|
|
22. A pattern such as "((?2){0,1999}())?", which has a group containing a
|
|
|
|
forward reference repeated a large (but limited) number of times within a
|
|
|
|
repeated outer group that has a zero minimum quantifier, caused incorrect code
|
|
|
|
to be compiled, leading to the error "internal error: previously-checked
|
|
|
|
referenced subpattern not found" when an incorrect memory address was read.
|
|
|
|
This bug was reported as "heap overflow", discovered by Kai Lu of Fortinet's
|
2015-03-24 06:21:34 -04:00
|
|
|
FortiGuard Labs. (Added 24-March-2015: CVE-2015-2325 was given to this.)
|
2015-02-28 06:31:51 -05:00
|
|
|
|
2015-03-01 13:34:05 -05:00
|
|
|
23. A pattern such as "((?+1)(\1))/" containing a forward reference subroutine
|
|
|
|
call within a group that also contained a recursive back reference caused
|
|
|
|
incorrect code to be compiled. This bug was reported as "heap overflow",
|
2015-03-24 06:21:34 -04:00
|
|
|
discovered by Kai Lu of Fortinet's FortiGuard Labs. (Added 24-March-2015:
|
|
|
|
CVE-2015-2326 was given to this.)
|
2015-03-01 13:34:05 -05:00
|
|
|
|
2015-03-06 02:57:23 -05:00
|
|
|
24. Computing the size of the JIT read-only data in advance has been a source
|
|
|
|
of various issues, and new ones are still appear unfortunately. To fix
|
|
|
|
existing and future issues, size computation is eliminated from the code,
|
|
|
|
and replaced by on-demand memory allocation.
|
|
|
|
|
2015-03-06 06:57:06 -05:00
|
|
|
25. A pattern such as /(?i)[A-`]/, where characters in the other case are
|
|
|
|
adjacent to the end of the range, and the range contained characters with more
|
|
|
|
than one other case, caused incorrect behaviour when compiled in UTF mode. In
|
|
|
|
that example, the range a-j was left out of the class.
|
|
|
|
|
2015-01-13 11:01:24 -05:00
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
Version 10.00 05-January-2015
|
2015-01-05 11:02:11 -05:00
|
|
|
-----------------------------
|
2014-08-26 11:41:31 -04:00
|
|
|
|
2014-11-24 10:31:28 -05:00
|
|
|
Version 10.00 is the first release of PCRE2, a revised API for the PCRE
|
|
|
|
library. Changes prior to 10.00 are logged in the ChangeLog file for the old
|
|
|
|
API, up to item 20 for release 8.36.
|
2014-08-26 11:41:31 -04:00
|
|
|
|
2014-10-20 13:28:49 -04:00
|
|
|
The code of the library was heavily revised as part of the new API
|
|
|
|
implementation. Details of each and every modification were not individually
|
|
|
|
logged. In addition to the API changes, the following changes were made. They
|
|
|
|
are either new functionality, or bug fixes and other noticeable changes of
|
2014-08-30 12:21:17 -04:00
|
|
|
behaviour that were implemented after the code had been forked.
|
2014-08-26 11:41:31 -04:00
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
1. Including Unicode support at build time is now enabled by default, but it
|
|
|
|
can optionally be disabled. It is not enabled by default at run time (no
|
|
|
|
change).
|
2014-11-03 13:27:56 -05:00
|
|
|
|
|
|
|
2. The test program, now called pcre2test, was re-specified and almost
|
2014-08-26 11:41:31 -04:00
|
|
|
completely re-written. Its input is not compatible with input for pcretest.
|
|
|
|
|
2014-11-03 13:27:56 -05:00
|
|
|
3. Patterns may start with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) to set the
|
2014-10-20 13:28:49 -04:00
|
|
|
PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART options for every subject line that is
|
2014-08-26 11:41:31 -04:00
|
|
|
matched by that pattern.
|
|
|
|
|
2014-11-03 13:27:56 -05:00
|
|
|
4. For the benefit of those who use PCRE2 via some other application, that is,
|
2014-10-20 13:28:49 -04:00
|
|
|
not writing the function calls themselves, it is possible to check the PCRE2
|
2014-11-24 10:31:28 -05:00
|
|
|
version by matching a pattern such as /(?(VERSION>=10)yes|no)/ against a
|
2014-08-26 11:41:31 -04:00
|
|
|
string such as "yesno".
|
|
|
|
|
2014-11-03 13:27:56 -05:00
|
|
|
5. There are case-equivalent Unicode characters whose encodings use different
|
2014-10-20 13:28:49 -04:00
|
|
|
numbers of code units in UTF-8. U+023A and U+2C65 are one example. (It is
|
|
|
|
theoretically possible for this to happen in UTF-16 too.) If a backreference to
|
|
|
|
a group containing one of these characters was greedily repeated, and during
|
2014-08-27 12:59:56 -04:00
|
|
|
the match a backtrack occurred, the subject might be backtracked by the wrong
|
2014-10-20 13:28:49 -04:00
|
|
|
number of code units. For example, if /^(\x{23a})\1*(.)/ is matched caselessly
|
|
|
|
(and in UTF-8 mode) against "\x{23a}\x{2c65}\x{2c65}\x{2c65}", group 2 should
|
2014-08-27 12:59:56 -04:00
|
|
|
capture the final character, which is the three bytes E2, B1, and A5 in UTF-8.
|
2014-10-20 13:28:49 -04:00
|
|
|
Incorrect backtracking meant that group 2 captured only the last two bytes.
|
|
|
|
This bug has been fixed; the new code is slower, but it is used only when the
|
2014-08-27 12:59:56 -04:00
|
|
|
strings matched by the repetition are not all the same length.
|
|
|
|
|
2014-11-03 13:27:56 -05:00
|
|
|
6. A pattern such as /()a/ was not setting the "first character must be 'a'"
|
2014-10-20 13:28:49 -04:00
|
|
|
information. This applied to any pattern with a group that matched no
|
2014-08-30 12:21:17 -04:00
|
|
|
characters, for example: /(?:(?=.)|(?<!x))a/.
|
|
|
|
|
2014-11-05 11:05:19 -05:00
|
|
|
7. When an (*ACCEPT) is triggered inside capturing parentheses, it arranges for
|
|
|
|
those parentheses to be closed with whatever has been captured so far. However,
|
2014-11-24 10:31:28 -05:00
|
|
|
it was failing to mark any other groups between the highest capture so far and
|
2014-11-05 11:05:19 -05:00
|
|
|
the currrent group as "unset". Thus, the ovector for those groups contained
|
|
|
|
whatever was previously there. An example is the pattern /(x)|((*ACCEPT))/ when
|
|
|
|
matched against "abcd".
|
|
|
|
|
2014-11-14 13:41:20 -05:00
|
|
|
8. The pcre2_substitute() function has been implemented.
|
|
|
|
|
2014-11-24 10:31:28 -05:00
|
|
|
9. If an assertion used as a condition was quantified with a minimum of zero
|
|
|
|
(an odd thing to do, but it happened), SIGSEGV or other misbehaviour could
|
|
|
|
occur.
|
2014-11-19 06:17:20 -05:00
|
|
|
|
2015-01-02 12:09:16 -05:00
|
|
|
10. The PCRE2_NO_DOTSTAR_ANCHOR option has been implemented.
|
|
|
|
|
2014-08-26 11:41:31 -04:00
|
|
|
****
|