2014-08-26 17:41:31 +02:00
|
|
|
Change Log for PCRE2
|
|
|
|
--------------------
|
|
|
|
|
2021-06-04 14:55:49 +02:00
|
|
|
Version 10.38-RC1 xx-xxx-2021
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
1. Fix invalid single character repetition issues in JIT when the repetition
|
|
|
|
is inside a capturing bracket and the bracket is preceeded by character
|
|
|
|
literals.
|
|
|
|
|
2021-07-11 17:15:24 +02:00
|
|
|
2. Installed revised CMake configuration files provided by Jan-Willem Blokland.
|
|
|
|
This extends the CMake build system to build both static and shared libraries
|
|
|
|
in one go, builds the static library with PIC, and exposes PCRE2 libraries
|
|
|
|
using the CMake config files. JWB provided these notes:
|
|
|
|
|
|
|
|
- Introduced CMake variable BUILD_STATIC_LIBS to build the static library.
|
|
|
|
|
|
|
|
- Make a small modification to config-cmake.h.in by removing the PCRE2_STATIC
|
|
|
|
variable. Added PCRE2_STATIC variable to the static build using the
|
|
|
|
target_compile_definitions() function.
|
|
|
|
|
|
|
|
- Extended the CMake config files.
|
|
|
|
|
|
|
|
- Introduced CMake variable PCRE2_USE_STATIC_LIBS to easily switch between
|
|
|
|
the static and shared libraries.
|
|
|
|
|
|
|
|
- Added the PCRE_STATIC variable to the target compile definitions for the
|
|
|
|
import of the static library.
|
|
|
|
|
|
|
|
Building static and shared libraries using MSVC results in a name clash of
|
|
|
|
the libraries. Both static and shared library builds create, for example, the
|
|
|
|
file pcre2-8.lib. Therefore, I decided to change the static library names by
|
|
|
|
adding "-static". For example, pcre2-8.lib has become pcre2-8-static.lib.
|
2021-08-28 13:11:27 +02:00
|
|
|
[Comment by PH: this is MSVC-specific. It doesn't happen on Linux.]
|
|
|
|
|
|
|
|
3. Increased the minimum release number for CMake to 3.0.0 because older than
|
|
|
|
2.8.12 is deprecated (it was set to 2.8.5) and causes warnings. Even 3.0.0 is
|
|
|
|
quote old; it was released in 2014.
|
2021-07-11 17:15:24 +02:00
|
|
|
|
|
|
|
|
2021-02-19 10:20:37 +01:00
|
|
|
|
2021-05-26 16:34:14 +02:00
|
|
|
Version 10.37 26-May-2021
|
|
|
|
-------------------------
|
2021-04-28 18:44:51 +02:00
|
|
|
|
|
|
|
1. Change RunGrepTest to use tr instead of sed when testing with binary
|
|
|
|
zero bytes, because sed varies a lot from system to system and has problems
|
|
|
|
with binary zeros. This is from Bugzilla #2681. Patch from Jeremie
|
|
|
|
Courreges-Anglas via Nam Nguyen. This fixes RunGrepTest for OpenBSD. Later:
|
|
|
|
it broke it for at least one version of Solaris, where tr can't handle binary
|
|
|
|
zeros. However, that system had /usr/xpg4/bin/tr installed, which works OK, so
|
2021-04-27 10:36:47 +02:00
|
|
|
RunGrepTest now checks for that command and uses it if found.
|
2021-01-04 18:17:48 +01:00
|
|
|
|
2021-04-28 18:44:51 +02:00
|
|
|
2. Compiling with gcc 10.2's -fanalyzer option showed up a hypothetical problem
|
|
|
|
with a NULL dereference. I don't think this case could ever occur in practice,
|
2021-01-14 17:56:44 +01:00
|
|
|
but I have put in a check in order to get rid of the compiler error.
|
|
|
|
|
2021-04-27 10:36:47 +02:00
|
|
|
3. An alternative patch for CMakeLists.txt because 10.36 #4 breaks CMake on
|
2021-01-14 18:14:58 +01:00
|
|
|
Windows. Patch from email@cs-ware.de fixes bugzilla #2688.
|
|
|
|
|
2021-04-28 18:44:51 +02:00
|
|
|
4. Two bugs related to over-large numbers have been fixed so the behaviour is
|
2021-02-01 18:56:12 +01:00
|
|
|
now the same as Perl.
|
2021-04-28 18:44:51 +02:00
|
|
|
|
|
|
|
(a) A pattern such as /\214748364/ gave an overflow error instead of being
|
2021-02-01 18:56:12 +01:00
|
|
|
treated as the octal number \214 followed by literal digits.
|
2021-04-28 18:44:51 +02:00
|
|
|
|
|
|
|
(b) A sequence such as {65536 that has no terminating } so is not a
|
2021-02-01 18:56:12 +01:00
|
|
|
quantifier was nevertheless complaining that a quantifier number was too big.
|
|
|
|
|
2021-02-02 18:02:55 +01:00
|
|
|
5. A run of autoconf suggested that configure.ac was out-of-date with respect
|
|
|
|
to the lastest autoconf. Running autoupdate made some valid changes, some valid
|
2021-04-28 18:44:51 +02:00
|
|
|
suggestions, and also some invalid changes, which were fixed by hand. Autoconf
|
|
|
|
now runs clean and the resulting "configure" seems to work, so I hope nothing
|
|
|
|
is broken. Later: the requirement for autoconf 2.70 broke some automatic test
|
2021-02-06 12:48:06 +01:00
|
|
|
robots. It doesn't seem to be necessary: trying a reduction to 2.60.
|
2021-02-02 18:02:55 +01:00
|
|
|
|
2021-02-18 10:46:08 +01:00
|
|
|
6. The pattern /a\K.(?0)*/ when matched against "abac" by the interpreter gave
|
2021-02-19 13:05:57 +01:00
|
|
|
the answer "bac", whereas Perl and JIT both yield "c". This was because the
|
|
|
|
effect of \K was not propagating back from the full pattern recursion. Other
|
|
|
|
recursions such as /(a\K.(?1)*)/ did not have this problem.
|
|
|
|
|
|
|
|
7. Restore single character repetition optimization in JIT. Currently fewer
|
|
|
|
character repetitions are optimized than in 10.34.
|
|
|
|
|
2021-04-27 10:36:47 +02:00
|
|
|
8. When the names of the functions in the POSIX wrapper were changed to
|
2021-04-28 18:44:51 +02:00
|
|
|
pcre2_regcomp() etc. (see change 10.33 #4 below), functions with the original
|
|
|
|
names were left in the library so that pre-compiled programs would still work.
|
|
|
|
However, this has proved troublesome when programs link with several libraries,
|
|
|
|
some of which use PCRE2 via the POSIX interface while others use a native POSIX
|
2021-04-27 10:36:47 +02:00
|
|
|
library. For this reason, the POSIX function names are removed in this release.
|
2021-04-28 18:44:51 +02:00
|
|
|
The macros in pcre2posix.h should ensure that re-compiling fixes any programs
|
2021-04-27 10:36:47 +02:00
|
|
|
that haven't been compiled since before 10.33.
|
2021-02-18 10:46:08 +01:00
|
|
|
|
2021-01-04 18:17:48 +01:00
|
|
|
|
|
|
|
Version 10.36 04-December-2020
|
|
|
|
------------------------------
|
2020-05-25 18:03:24 +02:00
|
|
|
|
|
|
|
1. Add CET_CFLAGS so that when Intel CET is enabled, pass -mshstk to
|
2020-11-06 18:27:35 +01:00
|
|
|
compiler. This fixes https://bugs.exim.org/show_bug.cgi?id=2578. Patch for
|
|
|
|
Makefile.am and configure.ac by H.J. Lu. Equivalent patch for CMakeLists.txt
|
2020-05-25 18:03:24 +02:00
|
|
|
invented by PH.
|
|
|
|
|
2020-05-29 16:20:23 +02:00
|
|
|
2. Fix inifinite loop when a single byte newline is searched in JIT when
|
|
|
|
invalid utf8 mode is enabled.
|
|
|
|
|
2020-06-01 18:36:00 +02:00
|
|
|
3. Updated CMakeLists.txt with patch from Wolfgang Stöggl (Bugzilla #2584):
|
|
|
|
|
|
|
|
- Include GNUInstallDirs and use ${CMAKE_INSTALL_LIBDIR} instead of hardcoded
|
|
|
|
lib. This allows differentiation between lib and lib64.
|
|
|
|
CMAKE_INSTALL_LIBDIR is used for installation of libraries and also for
|
|
|
|
pkgconfig file generation.
|
2020-11-06 18:27:35 +01:00
|
|
|
|
2020-06-01 18:36:00 +02:00
|
|
|
- Add the version of PCRE2 to the configuration summary like ./configure
|
|
|
|
does.
|
2020-11-06 18:27:35 +01:00
|
|
|
|
2020-06-01 18:36:00 +02:00
|
|
|
- Fix typo: MACTHED_STRING->MATCHED_STRING
|
2020-11-06 18:27:35 +01:00
|
|
|
|
2020-06-05 17:58:28 +02:00
|
|
|
4. Updated CMakeLists.txt with another patch from Wolfgang Stöggl (Bugzilla
|
|
|
|
#2588):
|
|
|
|
|
|
|
|
- Add escaped double quotes around include directory in CMakeLists.txt to
|
|
|
|
allow spaces in directory names.
|
|
|
|
|
|
|
|
- This fixes a cmake error, if the path of the pcre2 source contains a space.
|
2020-11-06 18:27:35 +01:00
|
|
|
|
|
|
|
5. Updated CMakeLists.txt with a patch from B. Scott Michel: CMake's
|
|
|
|
documentation suggests using CHECK_SYMBOL_EXISTS over CHECK_FUNCTION_EXIST.
|
|
|
|
Moreover, these functions come from specific header files, which need to be
|
|
|
|
specified (and, thankfully, are the same on both the Linux and WinXX
|
|
|
|
platforms.)
|
2020-06-01 18:36:00 +02:00
|
|
|
|
2020-06-05 18:11:01 +02:00
|
|
|
6. Added a (uint32_t) cast to prevent a compiler warning in pcre2_compile.c.
|
|
|
|
|
2020-06-22 17:51:19 +02:00
|
|
|
7. Applied a patch from Wolfgang Stöggl (Bugzilla #2600) to fix postfix for
|
|
|
|
debug Windows builds using CMake. This also updated configure so that it
|
|
|
|
generates *.pc files and pcre2-config with the same content, as in the past.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
8. If a pattern ended with (?(VERSION=n.d where n is any number but d is just a
|
|
|
|
single digit, the code unit beyond d was being read (i.e. there was a read
|
2020-06-29 17:35:49 +02:00
|
|
|
buffer overflow). Fixes ClusterFuzz 23779.
|
|
|
|
|
2020-07-15 06:35:32 +02:00
|
|
|
9. After the rework in r1235, certain character ranges were incorrectly
|
|
|
|
handled by an optimization in JIT. Furthermore a wrong offset was used to
|
|
|
|
read a value from a buffer which could lead to memory overread.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
10. Unnoticed for many years was the fact that delimiters other than / in the
|
|
|
|
testinput1 and testinput4 files could cause incorrect behaviour when these
|
|
|
|
files were processed by perltest.sh. There were several tests that used quotes
|
2020-09-13 17:56:32 +02:00
|
|
|
as delimiters, and it was just luck that they didn't go wrong with perltest.sh.
|
2020-11-06 18:27:35 +01:00
|
|
|
All the patterns in testinput1 and testinput4 now use / as their delimiter.
|
2020-09-13 17:56:32 +02:00
|
|
|
This fixes Bugzilla #2641.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
11. Perl has started to give an error for \K within lookarounds (though there
|
|
|
|
are cases where it doesn't). PCRE2 still allows this, so the tests that include
|
2020-09-13 17:56:32 +02:00
|
|
|
this case have been moved from test 1 to test 2.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
12. Further to 10 above, pcre2test has been updated to detect and grumble if a
|
2020-09-14 17:45:34 +02:00
|
|
|
delimiter other than / is used after #perltest.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
13. Fixed a bug with PCRE2_MATCH_INVALID_UTF in 8-bit mode when PCRE2_CASELESS
|
|
|
|
was set and PCRE2_NO_START_OPTIMIZE was not set. The optimization for finding
|
|
|
|
the start of a match was not resetting correctly after a failed match on the
|
|
|
|
first valid fragment of the subject, possibly causing incorrect "no match"
|
|
|
|
returns on subsequent fragments. For example, the pattern /A/ failed to match
|
|
|
|
the subject \xe5A. Fixes Bugzilla #2642.
|
2020-09-15 16:36:23 +02:00
|
|
|
|
2020-09-19 05:49:32 +02:00
|
|
|
14. Fixed a bug in character set matching when JIT is enabled and both unicode
|
|
|
|
scripts and unicode classes are present at the same time.
|
|
|
|
|
2020-10-04 18:34:31 +02:00
|
|
|
15. Added GNU grep's -m (aka --max-count) option to pcre2grep.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
16. Refactored substitution processing in pcre2grep strings, both for the -O
|
|
|
|
option and when dealing with callouts. There is now a single function that
|
|
|
|
handles $ expansion in all cases (instead of multiple copies of almost
|
|
|
|
identical code). This means that the same escape sequences are available
|
|
|
|
everywhere, which was not previously the case. At the same time, the escape
|
|
|
|
sequences $x{...} and $o{...} have been introduced, to allow for characters
|
2020-10-04 18:34:31 +02:00
|
|
|
whose code points are greater than 255 in Unicode mode.
|
|
|
|
|
2020-11-06 18:27:35 +01:00
|
|
|
17. Applied the patch from Bugzilla #2628 to RunGrepTest. This does an explicit
|
|
|
|
test for a version of sed that can handle binary zero, instead of assuming that
|
2020-12-04 15:30:03 +01:00
|
|
|
any Linux version will work. Later: replaced $(...) by `...` because not all
|
|
|
|
shells recognize the former.
|
2020-10-09 17:25:27 +02:00
|
|
|
|
2020-10-27 09:16:04 +01:00
|
|
|
18. Fixed a word boundary check bug in JIT when partial matching is enabled.
|
|
|
|
|
2020-11-13 09:04:06 +01:00
|
|
|
19. Fix ARM64 compilation warning in JIT. Patch by Carlo.
|
|
|
|
|
2020-12-04 15:30:03 +01:00
|
|
|
20. A bug in the RunTest script meant that if the first part of test 2 failed,
|
2020-11-22 16:16:05 +01:00
|
|
|
the failure was not reported.
|
|
|
|
|
2020-12-04 15:30:03 +01:00
|
|
|
21. Test 2 was failing when run from a directory other than the source
|
2020-11-22 16:16:05 +01:00
|
|
|
directory. This failure was previously missed in RunTest because of 20 above.
|
|
|
|
Fixes added to both RunTest and RunTest.bat.
|
|
|
|
|
2020-12-04 15:30:03 +01:00
|
|
|
22. Patch to CMakeLists.txt from Daniel to fix problem with testing under
|
|
|
|
Windows.
|
|
|
|
|
2020-05-25 18:03:24 +02:00
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
Version 10.35 09-May-2020
|
2020-04-15 18:34:36 +02:00
|
|
|
---------------------------
|
2019-11-28 12:35:08 +01:00
|
|
|
|
|
|
|
1. Use PCRE2_MATCH_EMPTY flag to detect empty matches in JIT.
|
|
|
|
|
2019-11-29 12:03:10 +01:00
|
|
|
2. Fix ARMv5 JIT improper handling of labels right after a constant pool.
|
|
|
|
|
2019-12-07 17:00:53 +01:00
|
|
|
3. A JIT bug is fixed which allowed to read the fields of the compiled
|
|
|
|
pattern before its existence is checked.
|
|
|
|
|
2020-01-22 18:50:12 +01:00
|
|
|
4. Back in the PCRE1 day, capturing groups that contained recursive back
|
|
|
|
references to themselves were made atomic (version 8.01, change 18) because
|
|
|
|
after the end a repeated group, the captured substrings had their values from
|
|
|
|
the final repetition, not from an earlier repetition that might be the
|
|
|
|
destination of a backtrack. This feature was documented, and was carried over
|
|
|
|
into PCRE2. However, it has now been realized that the major refactoring that
|
|
|
|
was done for 10.30 has made this atomicizing unnecessary, and it is confusing
|
|
|
|
when users are unaware of it, making some patterns appear not to be working as
|
2019-12-18 17:16:12 +01:00
|
|
|
expected. Capture values of recursive back references in repeated groups are
|
|
|
|
now correctly backtracked, so this unnecessary restriction has been removed.
|
|
|
|
|
2019-12-26 15:53:24 +01:00
|
|
|
5. Added PCRE2_SUBSTITUTE_LITERAL.
|
|
|
|
|
2019-12-26 16:10:26 +01:00
|
|
|
6. Avoid some VS compiler warnings.
|
|
|
|
|
2019-12-27 14:35:17 +01:00
|
|
|
7. Added PCRE2_SUBSTITUTE_MATCHED.
|
|
|
|
|
2020-01-22 18:50:12 +01:00
|
|
|
8. Added (?* and (?<* as synonms for (*napla: and (*naplb: to match another
|
|
|
|
regex engine. The Perl regex folks are aware of this usage and have made a note
|
2019-12-28 14:53:59 +01:00
|
|
|
about it.
|
|
|
|
|
2020-01-22 18:50:12 +01:00
|
|
|
9. When an assertion is repeated, PCRE2 used to limit the maximum repetition to
|
2020-01-01 13:07:02 +01:00
|
|
|
1, believing that repeating an assertion is pointless. However, if a positive
|
2020-01-22 18:50:12 +01:00
|
|
|
assertion contains capturing groups, repetition can be useful. In any case, an
|
|
|
|
assertion could always be wrapped in a repeated group. The only restriction
|
|
|
|
that is now imposed is that an unlimited maximum is changed to one more than
|
2020-01-01 13:07:02 +01:00
|
|
|
the minimum.
|
|
|
|
|
2020-01-11 16:28:15 +01:00
|
|
|
10. Fix *THEN verbs in lookahead assertions in JIT.
|
|
|
|
|
2020-01-22 18:50:12 +01:00
|
|
|
11. Added PCRE2_SUBSTITUTE_REPLACEMENT_ONLY.
|
|
|
|
|
2020-01-24 09:28:23 +01:00
|
|
|
12. The JIT stack should be freed when the low-level stack allocation fails.
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
13. In pcre2grep, if the final line in a scanned file is output but does not
|
2020-01-25 16:50:44 +01:00
|
|
|
end with a newline sequence, add a newline according to the --newline setting.
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
14. (?(DEFINE)...) groups were not being handled correctly when checking for
|
|
|
|
the fixed length of a lookbehind assertion. Such a group within a lookbehind
|
|
|
|
should be skipped, as it does not contribute to the length of the group.
|
|
|
|
Instead, the (DEFINE) group was being processed, and if at the end of the
|
|
|
|
lookbehind, that end was not correctly recognized. Errors such as "lookbehind
|
|
|
|
assertion is not fixed length" and also "internal error: bad code value in
|
2020-01-26 16:31:27 +01:00
|
|
|
parsed_skip()" could result.
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
15. Put a limit of 1000 on recursive calls in pcre2_study() when searching
|
|
|
|
nested groups for starting code units, in order to avoid stack overflow issues.
|
2020-01-27 11:28:19 +01:00
|
|
|
If the limit is reached, it just gives up trying for this optimization.
|
|
|
|
|
2020-02-10 11:18:01 +01:00
|
|
|
16. The control verb chain list must always be restored when exiting from a
|
|
|
|
recurse function in JIT.
|
|
|
|
|
2020-02-20 08:42:47 +01:00
|
|
|
17. Fix a crash which occurs when the character type of an invalid UTF
|
|
|
|
character is decoded in JIT.
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
18. Changes in many areas of the code so that when Unicode is supported and
|
|
|
|
PCRE2_UCP is set without PCRE2_UTF, Unicode character properties are used for
|
|
|
|
upper/lower case computations on characters whose code points are greater than
|
2020-02-26 17:53:39 +01:00
|
|
|
127.
|
2020-02-23 17:40:05 +01:00
|
|
|
|
2020-02-24 16:39:56 +01:00
|
|
|
19. The function for checking UTF-16 validity was returning an incorrect offset
|
|
|
|
for the start of the error when a high surrogate was not followed by a valid
|
|
|
|
low surrogate. This caused incorrect behaviour, for example when
|
|
|
|
PCRE2_MATCH_INVALID_UTF was set and a match started immediately following the
|
|
|
|
invalid high surrogate, such as /aa/ matching "\x{d800}aa".
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
20. If a DEFINE group immediately preceded a lookbehind assertion, the pattern
|
|
|
|
could be mis-compiled and therefore not match correctly. This is the example
|
|
|
|
that found this: /(?(DEFINE)(?<foo>bar))(?<![-a-z0-9])word/ which failed to
|
2020-02-24 18:29:00 +01:00
|
|
|
match "word" because the "move back" value was set to zero.
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
21. Following a request from a user, some extensions and tidies to the
|
2020-03-20 19:09:59 +01:00
|
|
|
character tables handling have been done:
|
|
|
|
|
2020-04-15 18:34:36 +02:00
|
|
|
(a) The dftables auxiliary program is renamed pcre2_dftables, but it is still
|
2020-03-20 19:09:59 +01:00
|
|
|
not installed for public use.
|
2020-04-15 18:34:36 +02:00
|
|
|
|
|
|
|
(b) There is now a -b option for pcre2_dftables, which causes the tables to
|
2020-03-20 19:09:59 +01:00
|
|
|
be written in binary. There is also a -help option.
|
2020-04-15 18:34:36 +02:00
|
|
|
|
|
|
|
(c) PCRE2_CONFIG_TABLES_LENGTH is added to pcre2_config() so that an
|
|
|
|
application that wants to save tables in binary knows how long they are.
|
|
|
|
|
|
|
|
22. Changed setting of CMAKE_MODULE_PATH in CMakeLists.txt from SET to
|
2020-03-24 18:45:28 +01:00
|
|
|
LIST(APPEND...) to allow a setting from the command line to be included.
|
2020-03-20 19:09:59 +01:00
|
|
|
|
2020-03-25 18:18:33 +01:00
|
|
|
23. Updated to Unicode 13.0.0.
|
|
|
|
|
2020-04-09 17:25:14 +02:00
|
|
|
24. CMake build now checks for secure_getenv() and strerror(). Patch by Carlo.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
25. Avoid using [-1] as a suffix in pcre2test because it can provoke a compiler
|
2020-04-23 17:41:23 +02:00
|
|
|
warning.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
26. Added tests for __attribute__((uninitialized)) to both the configure and
|
|
|
|
CMake build files, and then applied this attribute to the variable called
|
|
|
|
stack_frames_vector[] in pcre2_match(). When implemented, this disables
|
2020-04-23 18:50:45 +02:00
|
|
|
automatic initialization (a facility in clang), which can take time on big
|
|
|
|
variables.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
27. Updated CMakeLists.txt (patches by Uwe Korn) to add support for
|
|
|
|
pcre2-config, the libpcre*.pc files, SOVERSION, VERSION and the
|
2020-04-25 18:04:15 +02:00
|
|
|
MACHO_*_VERSIONS settings for CMake builds.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
28. Another patch to CMakeLists.txt to check for mkostemp (configure already
|
2020-04-28 16:26:24 +02:00
|
|
|
does). Patch by Carlo Marcelo Arenas Belon.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
29. Check for the existence of memfd_create in both CMake and configure
|
2020-04-28 17:03:58 +02:00
|
|
|
configurations. Patch by Carlo Marcelo Arenas Belon.
|
|
|
|
|
2020-05-09 17:47:41 +02:00
|
|
|
30. Restrict the configuration setting for the SELinux compatible execmem
|
2020-04-28 17:29:18 +02:00
|
|
|
allocator (change 10.30/44) to Linux and NetBSD.
|
|
|
|
|
2016-01-29 16:01:17 +01:00
|
|
|
|
2019-11-21 17:31:08 +01:00
|
|
|
Version 10.34 21-November-2019
|
|
|
|
------------------------------
|
2019-04-22 14:39:38 +02:00
|
|
|
|
2019-06-26 18:13:28 +02:00
|
|
|
1. The maximum number of capturing subpatterns is 65535 (documented), but no
|
2019-04-22 14:39:38 +02:00
|
|
|
check on this was ever implemented. This omission has been rectified; it fixes
|
|
|
|
ClusterFuzz 14376.
|
|
|
|
|
2019-05-10 15:15:20 +02:00
|
|
|
2. Improved the invalid utf32 support of the JIT compiler. Now it correctly
|
|
|
|
detects invalid characters in the 0xd800-0xdfff range.
|
|
|
|
|
2019-05-13 18:26:17 +02:00
|
|
|
3. Fix minor typo bug in JIT compile when \X is used in a non-UTF string.
|
|
|
|
|
2019-05-24 19:15:48 +02:00
|
|
|
4. Add support for matching in invalid UTF strings to the pcre2_match()
|
|
|
|
interpreter, and integrate with the existing JIT support via the new
|
|
|
|
PCRE2_MATCH_INVALID_UTF compile-time option.
|
|
|
|
|
2019-05-28 16:14:22 +02:00
|
|
|
5. Give more error detail for invalid UTF-8 when detected in pcre2grep.
|
|
|
|
|
|
|
|
6. Add support for invalid UTF-8 to pcre2grep.
|
|
|
|
|
2019-05-28 18:34:28 +02:00
|
|
|
7. Adjust the limit for "must have" code unit searching, in particular,
|
|
|
|
increase it substantially for non-anchored patterns.
|
|
|
|
|
2019-06-26 18:13:28 +02:00
|
|
|
8. Allow (*ACCEPT) to be quantified, because an ungreedy quantifier with a zero
|
2019-06-10 18:41:22 +02:00
|
|
|
minimum is potentially useful.
|
|
|
|
|
2019-06-13 18:00:11 +02:00
|
|
|
9. Some changes to the way the minimum subject length is handled:
|
|
|
|
|
2019-06-26 18:13:28 +02:00
|
|
|
* When PCRE2_NO_START_OPTIMIZE is set, no minimum length is computed;
|
2019-06-18 18:07:43 +02:00
|
|
|
pcre2test now omits this item instead of showing a value of zero.
|
2019-06-26 18:13:28 +02:00
|
|
|
|
|
|
|
* An incorrect minimum length could be calculated for a pattern that
|
|
|
|
contained (*ACCEPT) inside a qualified group whose minimum repetition was
|
2019-06-18 18:07:43 +02:00
|
|
|
zero, for example /A(?:(*ACCEPT))?B/, which incorrectly computed a minimum
|
2019-06-26 18:13:28 +02:00
|
|
|
of 2. The minimum length scan no longer happens for a pattern that
|
2019-06-18 18:07:43 +02:00
|
|
|
contains (*ACCEPT).
|
2019-06-26 18:13:28 +02:00
|
|
|
|
|
|
|
* When no minimum length is set by the normal scan, but a first and/or last
|
2019-06-13 18:00:11 +02:00
|
|
|
code unit is recorded, set the minimum to 1 or 2 as appropriate.
|
2019-06-26 18:13:28 +02:00
|
|
|
|
2019-06-16 17:37:45 +02:00
|
|
|
* When a pattern contains multiple groups with the same number, a back
|
|
|
|
reference cannot know which one to scan for a minimum length. This used to
|
|
|
|
cause the minimum length finder to give up with no result. Now it treats
|
2019-06-26 18:13:28 +02:00
|
|
|
such references as not adding to the minimum length (which it should have
|
2019-06-16 17:37:45 +02:00
|
|
|
done all along).
|
2019-06-26 18:13:28 +02:00
|
|
|
|
|
|
|
* Furthermore, the above action now happens only if the back reference is to
|
|
|
|
a group that exists more than once in a pattern instead of any back
|
|
|
|
reference in a pattern with duplicate numbers.
|
|
|
|
|
|
|
|
10. A (*MARK) value inside a successful condition was not being returned by the
|
2019-06-13 18:49:40 +02:00
|
|
|
interpretive matcher (it was returned by JIT). This bug has been mended.
|
2019-06-13 18:00:11 +02:00
|
|
|
|
2019-06-26 18:13:28 +02:00
|
|
|
11. A bug in pcre2grep meant that -o without an argument (or -o0) didn't work
|
|
|
|
if the pattern had more than 32 capturing parentheses. This is fixed. In
|
|
|
|
addition (a) the default limit for groups requested by -o<n> has been raised to
|
|
|
|
50, (b) the new --om-capture option changes the limit, (c) an error is raised
|
2019-06-15 17:51:07 +02:00
|
|
|
if -o asks for a group that is above the limit.
|
|
|
|
|
2019-06-19 18:27:50 +02:00
|
|
|
12. The quantifier {1} was always being ignored, but this is incorrect when it
|
|
|
|
is made possessive and applied to an item in parentheses, because a
|
|
|
|
parenthesized item may contain multiple branches or other backtracking points,
|
|
|
|
for example /(a|ab){1}+c/ or /(a+){1}+a/.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
13. For partial matches, pcre2test was always showing the maximum lookbehind
|
2019-06-26 18:13:28 +02:00
|
|
|
characters, flagged with "<", which is misleading when the lookbehind didn't
|
2019-06-26 10:23:47 +02:00
|
|
|
actually look behind the start (because it was later in the pattern). Showing
|
|
|
|
all consulted preceding characters for partial matches is now controlled by the
|
|
|
|
existing "allusedtext" modifier and, as for complete matches, this facility is
|
|
|
|
available only for non-JIT matching, because JIT does not maintain the first
|
|
|
|
and last consulted characters.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
14. DFA matching (using pcre2_dfa_match()) was not recognising a partial match
|
2019-06-26 18:13:28 +02:00
|
|
|
if the end of the subject was encountered in a lookahead (conditional or
|
|
|
|
otherwise), an atomic group, or a recursion.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
15. Give error if pcre2test -t, -T, -tm or -TM is given an argument of zero.
|
2019-07-03 19:15:37 +02:00
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
16. Check for integer overflow when computing lookbehind lengths. Fixes
|
2019-07-04 19:01:53 +02:00
|
|
|
Clusterfuzz issue 15636.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
17. Implemented non-atomic positive lookaround assertions.
|
2019-07-13 13:12:03 +02:00
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
18. If a lookbehind contained a lookahead that contained another lookbehind
|
2019-10-17 18:39:38 +02:00
|
|
|
within it, the nested lookbehind was not correctly processed. For example, if
|
|
|
|
/(?<=(?=(?<=a)))b/ was matched to "ab" it gave no match instead of matching
|
2019-07-16 17:06:21 +02:00
|
|
|
"b".
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
19. Implemented pcre2_get_match_data_size().
|
2019-07-16 17:50:09 +02:00
|
|
|
|
2019-09-06 18:08:45 +02:00
|
|
|
20. Two alterations to partial matching:
|
2019-07-21 18:48:13 +02:00
|
|
|
|
|
|
|
(a) The definition of a partial match is slightly changed: if a pattern
|
|
|
|
contains any lookbehinds, an empty partial match may be given, because this
|
|
|
|
is another situation where adding characters to the current subject can
|
|
|
|
lead to a full match. Example: /c*+(?<=[bc])/ with subject "ab".
|
2019-10-17 18:39:38 +02:00
|
|
|
|
|
|
|
(b) Similarly, if a pattern could match an empty string, an empty partial
|
|
|
|
match may be given. Example: /(?![ab]).*/ with subject "ab". This case
|
2019-07-22 18:30:44 +02:00
|
|
|
applies only to PCRE2_PARTIAL_HARD.
|
2019-10-17 18:39:38 +02:00
|
|
|
|
2019-07-22 18:30:44 +02:00
|
|
|
(c) An empty string partial hard match can be returned for \z and \Z as it
|
2019-10-17 18:39:38 +02:00
|
|
|
is documented that they shouldn't match.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
21. A branch that started with (*ACCEPT) was not being recognized as one that
|
2019-10-17 18:39:38 +02:00
|
|
|
could match an empty string.
|
2019-07-21 18:48:13 +02:00
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
22. Corrected pcre2_set_character_tables() tables data type: was const unsigned
|
2019-07-28 17:58:24 +02:00
|
|
|
char * instead of const uint8_t *, as generated by pcre2_maketables().
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
23. Upgraded to Unicode 12.1.0.
|
2019-07-29 17:32:36 +02:00
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
24. Add -jitfast command line option to pcre2test (to make all the jit options
|
2019-07-30 19:59:42 +02:00
|
|
|
available directly).
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
25. Make pcre2test -C show if libreadline or libedit is supported.
|
2019-07-30 19:59:42 +02:00
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
26. If the length of one branch of a group exceeded 65535 (the maximum value
|
2019-10-17 18:39:38 +02:00
|
|
|
that is remembered as a minimum length), the whole group's length was
|
|
|
|
incorrectly recorded as 65535, leading to incorrect "no match" when start-up
|
2019-08-03 10:30:40 +02:00
|
|
|
optimizations were in force.
|
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
27. The "rightmost consulted character" value was not always correct; in
|
|
|
|
particular, if a pattern ended with a negative lookahead, characters that were
|
2019-08-10 13:34:50 +02:00
|
|
|
inspected in that lookahead were not included.
|
|
|
|
|
2019-09-04 20:14:54 +02:00
|
|
|
28. Add the pcre2_maketables_free() function.
|
2019-09-03 16:16:07 +02:00
|
|
|
|
2019-09-06 18:08:45 +02:00
|
|
|
29. The start-up optimization that looks for a unique initial matching
|
|
|
|
code unit in the interpretive engines uses memchr() in 8-bit mode. When the
|
|
|
|
search is caseless, it was doing so inefficiently, which ended up slowing down
|
|
|
|
the match drastically when the subject was very long. The revised code (a)
|
2019-10-17 18:39:38 +02:00
|
|
|
remembers if one case is not found, so it never repeats the search for that
|
2019-09-06 18:08:45 +02:00
|
|
|
case after a bumpalong and (b) when one case has been found, it searches only
|
|
|
|
up to that position for an earlier occurrence of the other case. This fix
|
2019-10-17 18:39:38 +02:00
|
|
|
applies to both interpretive pcre2_match() and to pcre2_dfa_match().
|
2019-09-06 18:08:45 +02:00
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
30. While scanning to find the minimum length of a group, if any branch has
|
|
|
|
minimum length zero, there is no need to scan any subsequent branches (a small
|
2019-09-07 17:16:10 +02:00
|
|
|
compile-time performance improvement).
|
|
|
|
|
2019-09-07 17:27:05 +02:00
|
|
|
31. Installed a .gitignore file on a user's suggestion. When using the svn
|
|
|
|
repository with git (through git svn) this helps keep it tidy.
|
|
|
|
|
2019-09-09 19:00:19 +02:00
|
|
|
32. Add underflow check in JIT which may occur when the value of subject
|
2019-09-09 09:12:00 +02:00
|
|
|
string pointer is close to 0.
|
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
33. Arrange for classes such as [Aa] which contain just the two cases of the
|
|
|
|
same character, to be treated as a single caseless character. This causes the
|
2019-09-09 19:00:19 +02:00
|
|
|
first and required code unit optimizations to kick in where relevant.
|
|
|
|
|
2019-09-10 17:38:42 +02:00
|
|
|
34. Improve the bitmap of starting bytes for positive classes that include wide
|
|
|
|
characters, but no property types, in UTF-8 mode. Previously, on encountering
|
|
|
|
such a class, the bits for all bytes greater than \xc4 were set, thus
|
|
|
|
specifying any character with codepoint >= 0x100. Now the only bits that are
|
2019-10-17 18:39:38 +02:00
|
|
|
set are for the relevant bytes that start the wide characters. This can give a
|
2019-09-10 17:38:42 +02:00
|
|
|
noticeable performance improvement.
|
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
35. If the bitmap of starting code units contains only 1 or 2 bits, replace it
|
|
|
|
with a single starting code unit (1 bit) or a caseless single starting code
|
|
|
|
unit if the two relevant characters are case-partners. This is particularly
|
|
|
|
relevant to the 8-bit library, though it applies to all. It can give a
|
|
|
|
performance boost for patterns such as [Ww]ord and (word|WORD). However, this
|
|
|
|
optimization doesn't happen if there is a "required" code unit of the same
|
|
|
|
value (because the search for a "required" code unit starts at the match start
|
|
|
|
for non-unique first code unit patterns, but after a unique first code unit,
|
2019-09-13 19:02:06 +02:00
|
|
|
and patterns such as a*a need the former action).
|
|
|
|
|
2019-10-17 18:39:38 +02:00
|
|
|
36. Small patch to pcre2posix.c to set the erroroffset field to -1 immediately
|
|
|
|
after a successful compile, instead of at the start of matching to avoid a
|
2019-10-15 12:46:36 +02:00
|
|
|
sanitizer complaint (regexec is supposed to be thread safe).
|
|
|
|
|
2019-11-08 17:04:43 +01:00
|
|
|
37. Add NEON vectorization to JIT to speed up matching of first character and
|
|
|
|
pairs of characters on ARM64 CPUs.
|
|
|
|
|
2019-11-16 18:30:07 +01:00
|
|
|
38. If a non-ASCII character was the first in a starting assertion in a
|
|
|
|
caseless match, the "first code unit" optimization did not get the casing
|
|
|
|
right, and the assertion failed to match a character in the other case if it
|
|
|
|
did not start with the same code unit.
|
|
|
|
|
2019-11-19 13:25:32 +01:00
|
|
|
39. Fixed the incorrect computation of jump sizes on x86 CPUs in JIT. A masking
|
|
|
|
operation was incorrectly removed in r1136. Reported by Ralf Junker.
|
|
|
|
|
2019-04-22 14:39:38 +02:00
|
|
|
|
2019-04-16 17:34:27 +02:00
|
|
|
Version 10.33 16-April-2019
|
2019-03-11 18:29:08 +01:00
|
|
|
---------------------------
|
2018-02-19 15:49:42 +01:00
|
|
|
|
2018-09-24 18:23:53 +02:00
|
|
|
1. Added "allvector" to pcre2test to make it easy to check the part of the
|
|
|
|
ovector that shouldn't be changed, in particular after substitute and failed or
|
2018-09-15 19:10:39 +02:00
|
|
|
partial matches.
|
|
|
|
|
2018-09-18 12:19:14 +02:00
|
|
|
2. Fix subject buffer overread in JIT when UTF is disabled and \X or \R has
|
|
|
|
a greater than 1 fixed quantifier. This issue was found by Yunho Kim.
|
|
|
|
|
2019-03-11 18:29:08 +01:00
|
|
|
3. Added support for callouts from pcre2_substitute(). After 10.33-RC1, but
|
|
|
|
prior to release, fixed a bug that caused a crash if pcre2_substitute() was
|
|
|
|
called with a NULL match context.
|
2018-09-18 18:31:30 +02:00
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
4. The POSIX functions are now all called pcre2_regcomp() etc., with wrapper
|
2019-01-30 17:11:16 +01:00
|
|
|
functions that use the standard POSIX names. However, in pcre2posix.h the POSIX
|
|
|
|
names are defined as macros. This should help avoid linking with the wrong
|
|
|
|
library in some environments while still exporting the POSIX names for
|
2019-03-04 19:07:04 +01:00
|
|
|
pre-existing programs that use them. (The Debian alternative names are also
|
2019-01-30 17:11:16 +01:00
|
|
|
defined as macros, but not documented.)
|
2018-09-19 18:33:09 +02:00
|
|
|
|
2018-09-21 09:24:34 +02:00
|
|
|
5. Fix an xclass matching issue in JIT.
|
|
|
|
|
2018-09-21 18:59:48 +02:00
|
|
|
6. Implement PCRE2_EXTRA_ESCAPED_CR_IS_LF (see Bugzilla 2315).
|
|
|
|
|
2018-09-24 18:23:53 +02:00
|
|
|
7. Implement the Perl 5.28 experimental alphabetic names for atomic groups and
|
|
|
|
lookaround assertions, for example, (*pla:...) and (*atomic:...). These are
|
|
|
|
characterized by a lower case letter following (* and to simplify coding for
|
|
|
|
this, the character tables created by pcre2_maketables() were updated to add a
|
|
|
|
new "is lower case letter" bit. At the same time, the now unused "is
|
|
|
|
hexadecimal digit" bit was removed. The default tables in
|
|
|
|
src/pcre2_chartables.c.dist are updated.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
8. Implement the new Perl "script run" features (*script_run:...) and
|
2018-10-12 19:02:34 +02:00
|
|
|
(*atomic_script_run:...) aka (*sr:...) and (*asr:...).
|
2018-10-02 17:25:58 +02:00
|
|
|
|
2018-10-15 13:01:24 +02:00
|
|
|
9. Fixed two typos in change 22 for 10.21, which added special handling for
|
2019-03-04 19:07:04 +01:00
|
|
|
ranges such as a-z in EBCDIC environments. The original code probably never
|
|
|
|
worked, though there were no bug reports.
|
2018-10-15 13:01:24 +02:00
|
|
|
|
2018-10-17 10:33:38 +02:00
|
|
|
10. Implement PCRE2_COPY_MATCHED_SUBJECT for pcre2_match() (including JIT via
|
|
|
|
pcre2_match()) and pcre2_dfa_match(), but *not* the pcre2_jit_match() fast
|
2019-03-04 19:07:04 +01:00
|
|
|
path. Also, when a match fails, set the subject field in the match data to NULL
|
|
|
|
for tidiness - none of the substring extractors should reference this after
|
2018-10-19 17:31:16 +02:00
|
|
|
match failure.
|
2018-10-17 10:33:38 +02:00
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
11. If a pattern started with a subroutine call that had a quantifier with a
|
|
|
|
minimum of zero, an incorrect "match must start with this character" could be
|
|
|
|
recorded. Example: /(?&xxx)*ABC(?<xxx>XYZ)/ would (incorrectly) expect 'A' to
|
|
|
|
be the first character of a match.
|
2018-10-20 11:28:02 +02:00
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
12. The heap limit checking code in pcre2_dfa_match() could suffer from
|
|
|
|
overflow if the heap limit was set very large. This could cause incorrect "heap
|
|
|
|
limit exceeded" errors.
|
2018-10-22 18:47:55 +02:00
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
13. Add "kibibytes" to the heap limit output from pcre2test -C to make the
|
2018-10-22 18:56:11 +02:00
|
|
|
units clear.
|
|
|
|
|
2018-10-28 18:27:48 +01:00
|
|
|
14. Add a call to pcre2_jit_free_unused_memory() in pcre2grep, for tidiness.
|
|
|
|
|
2018-11-09 19:10:25 +01:00
|
|
|
15. Updated the VMS-specific code in pcre2test on the advice of a VMS user.
|
|
|
|
|
2018-11-14 17:59:19 +01:00
|
|
|
16. Removed the unnecessary inclusion of stdint.h (or inttypes.h) from
|
|
|
|
pcre2_internal.h as it is now included by pcre2.h. Also, change 17 for 10.32
|
|
|
|
below was unnecessarily complicated, as inttypes.h is a Standard C header,
|
|
|
|
which is defined to be a superset of stdint.h. Instead of conditionally
|
|
|
|
including stdint.h or inttypes.h, pcre2.h now unconditionally includes
|
|
|
|
inttypes.h. This supports environments that do not have stdint.h but do have
|
|
|
|
inttypes.h, which are known to exist. A note in the autotools documentation
|
|
|
|
says (November 2018) that there are none known that are the other way round.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
17. Added --disable-percent-zt to "configure" (and equivalent to CMake) to
|
|
|
|
forcibly disable the use of %zu and %td in formatting strings because there is
|
|
|
|
at least one version of VMS that claims to be C99 but does not support these
|
2018-11-15 19:09:02 +01:00
|
|
|
modifiers.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
18. Added --disable-pcre2grep-callout-fork, which restricts the callout support
|
|
|
|
in pcre2grep to the inbuilt echo facility. This may be useful in environments
|
2018-11-17 17:45:57 +01:00
|
|
|
that do not support fork().
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
19. Fix two instances of <= 0 being applied to unsigned integers (the VMS
|
2018-11-17 17:59:39 +01:00
|
|
|
compiler complains).
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
20. Added "fork" support for VMS to pcre2grep, for running an external program
|
2018-11-24 17:31:10 +01:00
|
|
|
via a string callout.
|
|
|
|
|
2018-11-25 18:11:52 +01:00
|
|
|
21. Improve MAP_JIT flag usage on MacOS. Patch by Rich Siegel.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
22. If a pattern started with (*MARK), (*COMMIT), (*PRUNE), (*SKIP), or (*THEN)
|
2018-11-27 17:00:58 +01:00
|
|
|
followed by ^ it was not recognized as anchored.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
23. The RunGrepTest script used to cut out the test of NUL characters for
|
|
|
|
Solaris and MacOS as printf and sed can't handle them. It seems that the *BSD
|
|
|
|
systems can't either. I've inverted the test so that only those OS that are
|
2018-12-06 18:05:06 +01:00
|
|
|
known to work (currently only Linux) try to run this test.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
24. Some tests in RunGrepTest appended to testtrygrep from two different file
|
|
|
|
descriptors instead of redirecting stderr to stdout. This worked on Linux, but
|
2018-12-06 18:13:41 +01:00
|
|
|
it was reported not to on other systems, causing the tests to fail.
|
|
|
|
|
2018-12-07 17:32:05 +01:00
|
|
|
25. In the RunTest script, make the test for stack setting use the same value
|
|
|
|
for the stack as it needs for -bigstack.
|
|
|
|
|
2018-12-14 17:02:29 +01:00
|
|
|
26. Insert a cast in pcre2_dfa_match.c to suppress a compiler warning.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
26. With PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL set, escape sequences such as \s
|
|
|
|
which are valid in character classes, but not as the end of ranges, were being
|
|
|
|
treated as literals. An example is [_-\s] (but not [\s-_] because that gave an
|
|
|
|
error at the *start* of a range). Now an "invalid range" error is given
|
2019-01-04 17:41:32 +01:00
|
|
|
independently of PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
27. Related to 26 above, PCRE2_BAD_ESCAPE_IS_LITERAL was affecting known escape
|
2019-01-04 17:41:32 +01:00
|
|
|
sequences such as \eX when they appeared invalidly in a character class. Now
|
|
|
|
the option applies only to unrecognized or malformed escape sequences.
|
|
|
|
|
2019-01-17 12:47:59 +01:00
|
|
|
28. Fix word boundary in JIT compiler. Patch by Mike Munday.
|
|
|
|
|
2019-01-29 15:34:59 +01:00
|
|
|
29. The pcre2_dfa_match() function was incorrectly handling conditional version
|
2019-03-04 19:07:04 +01:00
|
|
|
tests such as (?(VERSION>=0)...) when the version test was true. Incorrect
|
2019-01-29 15:34:59 +01:00
|
|
|
processing or a crash could result.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
30. When PCRE2_UTF is set, allow non-ASCII letters and decimal digits in group
|
2019-02-07 18:29:50 +01:00
|
|
|
names, as Perl does. There was a small bug in this new code, found by
|
|
|
|
ClusterFuzz 12950, fixed before release.
|
2019-02-06 19:11:36 +01:00
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
31. Implemented PCRE2_EXTRA_ALT_BSUX to support ECMAScript 6's \u{hhh}
|
2019-02-12 18:50:19 +01:00
|
|
|
construct.
|
|
|
|
|
2019-02-13 18:30:24 +01:00
|
|
|
32. Compile \p{Any} to be the same as . in DOTALL mode, so that it benefits
|
|
|
|
from auto-anchoring if \p{Any}* starts a pattern.
|
|
|
|
|
2019-02-14 08:33:57 +01:00
|
|
|
33. Compile invalid UTF check in JIT test when only pcre32 is enabled.
|
|
|
|
|
2019-03-04 19:07:04 +01:00
|
|
|
34. For some time now, CMake has been warning about the setting of policy
|
|
|
|
CMP0026 to "OLD" in CmakeLists.txt, and hinting that the feature might be
|
|
|
|
removed in a future version. A request for CMake expertise on the list produced
|
|
|
|
no result, so I have now hacked CMakeLists.txt along the lines of some changes
|
|
|
|
I found on the Internet. The new code no longer needs the policy setting, and
|
|
|
|
it appears to work fine on Linux.
|
2019-02-16 12:58:37 +01:00
|
|
|
|
2019-03-01 17:19:49 +01:00
|
|
|
35. Setting --enable-jit=auto for an out-of-tree build failed because the
|
2019-03-04 19:07:04 +01:00
|
|
|
source directory wasn't in the search path for AC_TRY_COMPILE always. Patch
|
2019-03-01 17:19:49 +01:00
|
|
|
from Ross Burton.
|
|
|
|
|
2019-03-25 15:10:24 +01:00
|
|
|
36. Disable SSE2 JIT optimizations in x86 CPUs when SSE2 is not available.
|
|
|
|
Patch by Guillem Jover.
|
|
|
|
|
2019-04-16 17:34:27 +02:00
|
|
|
37. Changed expressions such as 1<<10 to 1u<<10 in many places because compiler
|
2019-04-12 16:40:27 +02:00
|
|
|
warnings were reported.
|
|
|
|
|
2019-04-16 17:34:27 +02:00
|
|
|
38. Using the clang compiler with sanitizing options causes runtime complaints
|
|
|
|
about truncation for statments such as x = ~x when x is an 8-bit value; it
|
|
|
|
seems to compute ~x as a 32-bit value. Changing such statements to x = 255 ^ x
|
|
|
|
gets rid of the warnings. There were also two missing casts in pcre2test.
|
|
|
|
|
2018-09-15 19:10:39 +02:00
|
|
|
|
|
|
|
Version 10.32 10-September-2018
|
|
|
|
-------------------------------
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
1. When matching using the the REG_STARTEND feature of the POSIX API with a
|
2018-02-19 15:49:42 +01:00
|
|
|
non-zero starting offset, unset capturing groups with lower numbers than a
|
2018-08-13 13:57:09 +02:00
|
|
|
group that did capture something were not being correctly returned as "unset"
|
2018-02-19 15:49:42 +01:00
|
|
|
(that is, with offset values of -1).
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
2. When matching using the POSIX API, pcre2test used to omit listing unset
|
2018-02-19 15:49:42 +01:00
|
|
|
groups altogether. Now it shows those that come before any actual captures as
|
|
|
|
"<unset>", as happens for non-POSIX matching.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
3. Running "pcre2test -C" always stated "\R matches CR, LF, or CRLF only",
|
|
|
|
whatever the build configuration was. It now correctly says "\R matches all
|
|
|
|
Unicode newlines" in the default case when --enable-bsr-anycrlf has not been
|
|
|
|
specified. Similarly, running "pcre2test -C bsr" never produced the result
|
2018-02-19 18:00:45 +01:00
|
|
|
ANY.
|
2018-02-19 17:55:47 +01:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
4. Matching the pattern /(*UTF)\C[^\v]+\x80/ against an 8-bit string containing
|
|
|
|
multi-code-unit characters caused bad behaviour and possibly a crash. This
|
2018-02-19 18:26:33 +01:00
|
|
|
issue was fixed for other kinds of repeat in release 10.20 by change 19, but
|
|
|
|
repeating character classes were overlooked.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
5. pcre2grep now supports the inclusion of binary zeros in patterns that are
|
2018-02-24 18:09:19 +01:00
|
|
|
read from files via the -f option.
|
|
|
|
|
2018-02-25 13:12:48 +01:00
|
|
|
6. A small fix to pcre2grep to avoid compiler warnings for -Wformat-overflow=2.
|
|
|
|
|
2018-02-25 19:00:29 +01:00
|
|
|
7. Added --enable-jit=auto support to configure.ac.
|
|
|
|
|
2018-02-27 18:19:51 +01:00
|
|
|
8. Added some dummy variables to the heapframe structure in 16-bit and 32-bit
|
|
|
|
modes for the benefit of m68k, where pointers can be 16-bit aligned. The
|
|
|
|
dummies force 32-bit alignment and this ensures that the structure is a
|
|
|
|
multiple of PCRE2_SIZE, a requirement that is tested at compile time. In other
|
|
|
|
architectures, alignment requirements take care of this automatically.
|
|
|
|
|
2018-03-04 16:13:37 +01:00
|
|
|
9. When returning an error from pcre2_pattern_convert(), ensure the error
|
|
|
|
offset is set zero for early errors.
|
|
|
|
|
2018-04-19 18:52:57 +02:00
|
|
|
10. A number of patches for Windows support from Daniel Richard G:
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
(a) List of error numbers in Runtest.bat corrected (it was not the same as in
|
|
|
|
Runtest).
|
|
|
|
|
2018-04-19 18:52:57 +02:00
|
|
|
(b) pcre2grep snprintf() workaround as used elsewhere in the tree.
|
2018-08-13 13:57:09 +02:00
|
|
|
|
|
|
|
(c) Support for non-C99 snprintf() that returns -1 in the overflow case.
|
|
|
|
|
|
|
|
11. Minor tidy of pcre2_dfa_match() code.
|
|
|
|
|
|
|
|
12. Refactored pcre2_dfa_match() so that the internal recursive calls no longer
|
|
|
|
use the stack for local workspace and local ovectors. Instead, an initial block
|
|
|
|
of stack is reserved, but if this is insufficient, heap memory is used. The
|
2018-04-27 18:48:35 +02:00
|
|
|
heap limit parameter now applies to pcre2_dfa_match().
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
13. If a "find limits" test of DFA matching in pcre2test resulted in too many
|
2018-04-27 18:48:35 +02:00
|
|
|
matches for the ovector, no matches were displayed.
|
2018-04-19 18:52:57 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
14. Removed an occurrence of ctrl/Z from test 6 because Windows treats it as
|
2018-04-28 18:05:48 +02:00
|
|
|
EOF. The test looks to have come from a fuzzer.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
15. If PCRE2 was built with a default match limit a lot greater than the
|
2018-04-29 17:07:44 +02:00
|
|
|
default default of 10 000 000, some JIT tests of the match limit no longer
|
|
|
|
failed. All such tests now set 10 000 000 as the upper limit.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
16. Another Windows related patch for pcregrep to ensure that WIN32 is
|
|
|
|
undefined under Cygwin.
|
2018-06-19 18:27:42 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
17. Test for the presence of stdint.h and inttypes.h in configure and CMake and
|
|
|
|
include whichever exists (stdint preferred) instead of unconditionally
|
2018-06-19 19:41:01 +02:00
|
|
|
including stdint. This makes life easier for old and non-standard systems.
|
|
|
|
|
2018-06-20 19:05:31 +02:00
|
|
|
18. Further changes to improve portability, especially to old and or non-
|
|
|
|
standard systems:
|
|
|
|
|
|
|
|
(a) Put all printf arguments in RunGrepTest into single, not double, quotes,
|
2018-08-13 13:57:09 +02:00
|
|
|
and use \0 not \x00 for binary zero.
|
|
|
|
|
2018-06-20 19:05:31 +02:00
|
|
|
(b) Avoid the use of C++ (i.e. BCPL) // comments.
|
2018-08-13 13:57:09 +02:00
|
|
|
|
2018-06-20 19:05:31 +02:00
|
|
|
(c) Parameterize the use of %zu in pcre2test to make it like %td. For both of
|
2018-08-13 13:57:09 +02:00
|
|
|
these now, if using MSVC or a standard C before C99, %lu is used with a
|
|
|
|
cast if necessary.
|
|
|
|
|
|
|
|
19. Applied a contributed patch to CMakeLists.txt to increase the stack size
|
2018-06-27 18:34:06 +02:00
|
|
|
when linking pcre2test with MSVC. This gets rid of a stack overflow error in
|
|
|
|
the standard set of tests.
|
2018-07-02 12:54:03 +02:00
|
|
|
|
|
|
|
20. Output a warning in pcre2test when ignoring the "altglobal" modifier when
|
|
|
|
it is given with the "replace" modifier.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
21. In both pcre2test and pcre2_substitute(), with global matching, a pattern
|
|
|
|
that matched an empty string, but never at the starting match offset, was not
|
|
|
|
handled in a Perl-compatible way. The pattern /(<?=\G.)/ is an example of such
|
|
|
|
a pattern. Because \G is in a lookbehind assertion, there has to be a
|
|
|
|
"bumpalong" before there can be a match. The automatic "advance by one
|
|
|
|
character after an empty string match" rule is therefore inappropriate. A more
|
2018-07-02 12:54:03 +02:00
|
|
|
complicated algorithm has now been implemented.
|
2018-07-02 13:23:45 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
22. When checking to see if a lookbehind is of fixed length, lookaheads were
|
|
|
|
correctly ignored, but qualifiers on lookaheads were not being ignored, leading
|
2018-07-02 13:23:45 +02:00
|
|
|
to an incorrect "lookbehind assertion is not fixed length" error.
|
2018-07-02 14:26:04 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
23. The VERSION condition test was reading fractional PCRE2 version numbers
|
2018-07-02 14:26:04 +02:00
|
|
|
such as the 04 in 10.04 incorrectly and hence giving wrong results.
|
2018-07-07 18:10:29 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
24. Updated to Unicode version 11.0.0. As well as the usual addition of new
|
2018-07-07 18:10:29 +02:00
|
|
|
scripts and characters, this involved re-jigging the grapheme break property
|
|
|
|
algorithm because Unicode has changed the way emojis are handled.
|
2018-07-16 17:24:32 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
25. Fixed an obscure bug that struck when there were two atomic groups not
|
|
|
|
separated by something with a backtracking point. There could be an incorrect
|
2018-07-16 17:24:32 +02:00
|
|
|
backtrack into the first of the atomic groups. A complicated example is
|
2018-08-13 13:57:09 +02:00
|
|
|
/(?>a(*:1))(?>b)(*SKIP:1)x|.*/ matched against "abc", where the *SKIP
|
2018-07-16 17:24:32 +02:00
|
|
|
shouldn't find a MARK (because is in an atomic group), but it did.
|
2018-07-17 18:00:09 +02:00
|
|
|
|
|
|
|
26. Upgraded the perltest.sh script: (1) #pattern lines can now be used to set
|
2018-07-21 16:34:51 +02:00
|
|
|
a list of modifiers for all subsequent patterns - only those that the script
|
|
|
|
recognizes are meaningful; (2) #subject lines can be used to set or unset a
|
|
|
|
default "mark" modifier; (3) Unsupported #command lines give a warning when
|
|
|
|
they are ignored; (4) Mark data is output only if the "mark" modifier is
|
|
|
|
present.
|
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
27. (*ACCEPT:ARG), (*FAIL:ARG), and (*COMMIT:ARG) are now supported.
|
2018-07-21 16:34:51 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
28. A (*MARK) name was not being passed back for positive assertions that were
|
2018-07-21 16:34:51 +02:00
|
|
|
terminated by (*ACCEPT).
|
2018-07-27 18:30:40 +02:00
|
|
|
|
2018-09-02 18:03:27 +02:00
|
|
|
29. Add support for \N{U+dddd}, but only in Unicode mode.
|
2018-07-28 18:23:24 +02:00
|
|
|
|
|
|
|
30. Add support for (?^) for unsetting all imnsx options.
|
2018-08-03 11:38:36 +02:00
|
|
|
|
|
|
|
31. The PCRE2_EXTENDED (/x) option only ever discarded space characters whose
|
|
|
|
code point was less than 256 and that were recognized by the lookup table
|
|
|
|
generated by pcre2_maketables(), which uses isspace() to identify white space.
|
|
|
|
Now, when Unicode support is compiled, PCRE2_EXTENDED also discards U+0085,
|
|
|
|
U+200E, U+200F, U+2028, and U+2029, which are additional characters defined by
|
|
|
|
Unicode as "Pattern White Space". This makes PCRE2 compatible with Perl.
|
2018-08-04 10:20:18 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
32. In certain circumstances, option settings within patterns were not being
|
|
|
|
correctly processed. For example, the pattern /((?i)A)(?m)B/ incorrectly
|
|
|
|
matched "ab". (The (?m) setting lost the fact that (?i) should be reset at the
|
|
|
|
end of its group during the parse process, but without another setting such as
|
2018-08-04 10:20:18 +02:00
|
|
|
(?m) the compile phase got it right.) This bug was introduced by the
|
|
|
|
refactoring in release 10.23.
|
2018-08-10 18:27:44 +02:00
|
|
|
|
2018-08-13 13:57:09 +02:00
|
|
|
33. PCRE2 uses bcopy() if available when memmove() is not, and it used just to
|
2018-08-10 18:27:44 +02:00
|
|
|
define memmove() as function call to bcopy(). This hasn't been tested for a
|
2018-08-13 13:57:09 +02:00
|
|
|
long time because in pcre2test the result of memmove() was being used, whereas
|
|
|
|
bcopy() doesn't return a result. This feature is now refactored always to call
|
|
|
|
an emulation function when there is no memmove(). The emulation makes use of
|
2018-08-10 18:27:44 +02:00
|
|
|
bcopy() when available.
|
2018-08-13 13:57:09 +02:00
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
34. When serializing a pattern, set the memctl, executable_jit, and tables
|
|
|
|
fields (that is, all the fields that contain pointers) to zeros so that the
|
|
|
|
result of serializing is always the same. These fields are re-set when the
|
2018-08-15 20:03:29 +02:00
|
|
|
pattern is deserialized.
|
|
|
|
|
2018-08-17 16:45:35 +02:00
|
|
|
35. In a pattern such as /[^\x{100}-\x{ffff}]*[\x80-\xff]/ which has a repeated
|
|
|
|
negative class with no characters less than 0x100 followed by a positive class
|
2018-09-11 16:27:39 +02:00
|
|
|
with only characters less than 0x100, the first class was incorrectly being
|
2018-08-17 16:45:35 +02:00
|
|
|
auto-possessified, causing incorrect match failures.
|
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
36. Removed the character type bit ctype_meta, which dates from PCRE1 and is
|
2018-08-19 17:44:06 +02:00
|
|
|
not used in PCRE2.
|
|
|
|
|
2018-08-19 18:54:41 +02:00
|
|
|
37. Tidied up unnecessarily complicated macros used in the escapes table.
|
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
38. Since 10.21, the new testoutput8-16-4 file has accidentally been omitted
|
|
|
|
from distribution tarballs, owing to a typo in Makefile.am which had
|
2018-08-29 10:26:29 +02:00
|
|
|
testoutput8-16-3 twice. Now fixed.
|
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
39. If the only branch in a conditional subpattern was anchored, the whole
|
|
|
|
subpattern was treated as anchored, when it should not have been, since the
|
|
|
|
assumed empty second branch cannot be anchored. Demonstrated by test patterns
|
2018-09-02 18:53:29 +02:00
|
|
|
such as /(?(1)^())b/ or /(?(?=^))b/.
|
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
40. A repeated conditional subpattern that could match an empty string was
|
2018-09-03 17:20:40 +02:00
|
|
|
always assumed to be unanchored. Now it it checked just like any other
|
2018-09-11 16:27:39 +02:00
|
|
|
repeated conditional subpattern, and can be found to be anchored if the minimum
|
2018-09-03 17:20:40 +02:00
|
|
|
quantifier is one or more. I can't see much use for a repeated anchored
|
|
|
|
pattern, but the behaviour is now consistent.
|
|
|
|
|
2018-09-11 16:27:39 +02:00
|
|
|
41. Minor addition to pcre2_jit_compile.c to avoid static analyzer complaint
|
2018-09-06 17:59:11 +02:00
|
|
|
(for an event that could never occur but you had to have external information
|
|
|
|
to know that).
|
|
|
|
|
2018-09-10 19:34:19 +02:00
|
|
|
42. If before the first match in a file that was being searched by pcre2grep
|
|
|
|
there was a line that was sufficiently long to cause the input buffer to be
|
|
|
|
expanded, the variable holding the location of the end of the previous match
|
|
|
|
was being adjusted incorrectly, and could cause an overflow warning from a code
|
|
|
|
sanitizer. However, as the value is used only to print pending "after" lines
|
2018-09-11 16:27:39 +02:00
|
|
|
when the next match is reached (and there are no such lines in this case) this
|
2018-09-10 19:34:19 +02:00
|
|
|
bug could do no damage.
|
|
|
|
|
2018-02-19 15:49:42 +01:00
|
|
|
|
2018-02-12 12:33:56 +01:00
|
|
|
Version 10.31 12-February-2018
|
|
|
|
------------------------------
|
2017-08-28 16:59:04 +02:00
|
|
|
|
2017-09-12 18:28:42 +02:00
|
|
|
1. Fix typo (missing ]) in VMS code in pcre2test.c.
|
|
|
|
|
|
|
|
2. Replace the replicated code for matching extended Unicode grapheme sequences
|
|
|
|
(which got a lot more complicated by change 10.30/49) by a single subroutine
|
|
|
|
that is called by both pcre2_match() and pcre2_dfa_match().
|
2017-08-28 16:59:04 +02:00
|
|
|
|
2017-09-13 11:07:00 +02:00
|
|
|
3. Add idempotent guard to pcre2_internal.h.
|
|
|
|
|
2017-09-16 13:39:38 +02:00
|
|
|
4. Add new pcre2_config() options: PCRE2_CONFIG_NEVER_BACKSLASH_C and
|
|
|
|
PCRE2_CONFIG_COMPILED_WIDTHS.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
5. Cut out \C tests in the JIT regression tests when NEVER_BACKSLASH_C is
|
2017-09-16 13:46:08 +02:00
|
|
|
defined (e.g. by --enable-never-backslash-C).
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
6. Defined public names for all the pcre2_compile() error numbers, and used
|
2017-09-17 18:56:41 +02:00
|
|
|
the public names in pcre2_convert.c.
|
|
|
|
|
2017-09-18 17:51:44 +02:00
|
|
|
7. Fixed a small memory leak in pcre2test (convert contexts).
|
|
|
|
|
2017-09-26 19:01:23 +02:00
|
|
|
8. Added two casts to compile.c and one to match.c to avoid compiler warnings.
|
|
|
|
|
2017-10-11 18:49:10 +02:00
|
|
|
9. Added code to pcre2grep when compiled under VMS to set the symbol
|
|
|
|
PCRE2GREP_RC to the exit status, because VMS does not distinguish between
|
|
|
|
exit(0) and exit(1).
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
10. Added the -LM (list modifiers) option to pcre2test. Also made -C complain
|
|
|
|
about a bad option only if the following argument item does not start with a
|
2017-10-17 18:26:20 +02:00
|
|
|
hyphen.
|
|
|
|
|
2017-10-20 18:51:59 +02:00
|
|
|
11. pcre2grep was truncating components of file names to 128 characters when
|
|
|
|
processing files with the -r option, and also (some very odd code) truncating
|
|
|
|
path names to 512 characters. There is now a check on the absolute length of
|
|
|
|
full path file names, which may be up to 2047 characters long.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
12. When an assertion contained (*ACCEPT) it caused all open capturing groups
|
|
|
|
to be closed (as for a non-assertion ACCEPT), which was wrong and could lead to
|
|
|
|
misbehaviour for subsequent references to groups that started outside the
|
2018-02-12 12:33:56 +01:00
|
|
|
assertion. ACCEPT in an assertion now closes only those groups that were
|
2017-10-29 17:58:38 +01:00
|
|
|
started within that assertion. Fixes oss-fuzz issues 3852 and 3891.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
13. Multiline matching in pcre2grep was misbehaving if the pattern matched
|
|
|
|
within a line, and then matched again at the end of the line and over into
|
|
|
|
subsequent lines. Behaviour was different with and without colouring, and
|
|
|
|
sometimes context lines were incorrectly printed and/or line endings were lost.
|
2017-11-13 17:52:39 +01:00
|
|
|
All these issues should now be fixed.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
14. If --line-buffered was specified for pcre2grep when input was from a
|
|
|
|
compressed file (.gz or .bz2) a segfault occurred. (Line buffering should be
|
2017-11-13 18:12:55 +01:00
|
|
|
ignored for compressed files.)
|
|
|
|
|
2017-11-23 08:54:39 +01:00
|
|
|
15. Although pcre2_jit_match checks whether the pattern is compiled
|
|
|
|
in a given mode, it was also expected that at least one mode is available.
|
|
|
|
This is fixed and pcre2_jit_match returns with PCRE2_ERROR_JIT_BADOPTION
|
|
|
|
when the pattern is not optimized by JIT at all.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
16. The line number and related variables such as match counts in pcre2grep
|
|
|
|
were all int variables, causing overflow when files with more than 2147483647
|
|
|
|
lines were processed (assuming 32-bit ints). They have all been changed to
|
2017-12-08 11:25:49 +01:00
|
|
|
unsigned long ints.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
17. If a backreference with a minimum repeat count of zero was first in a
|
|
|
|
pattern, apart from assertions, an incorrect first matching character could be
|
|
|
|
recorded. For example, for the pattern /(?=(a))\1?b/, "b" was incorrectly set
|
2017-12-12 16:01:51 +01:00
|
|
|
as the first character of a match.
|
|
|
|
|
2017-12-12 17:23:01 +01:00
|
|
|
18. Characters in a leading positive assertion are considered for recording a
|
|
|
|
first character of a match when the rest of the pattern does not provide one.
|
|
|
|
However, a character in a non-assertive group within a leading assertion such
|
2017-12-22 16:56:27 +01:00
|
|
|
as in the pattern /(?=(a))\1?b/ caused this process to fail. This was an
|
|
|
|
infelicity rather than an outright bug, because it did not affect the result of
|
|
|
|
a match, just its speed. (In fact, in this case, the starting 'a' was
|
2017-12-12 17:23:01 +01:00
|
|
|
subsequently picked up in the study.)
|
|
|
|
|
2017-12-16 17:07:29 +01:00
|
|
|
19. A minor tidy in pcre2_match(): making all PCRE2_ERROR_ returns use "return"
|
2017-12-22 16:56:27 +01:00
|
|
|
instead of "RRETURN" saves unwinding the backtracks in these cases (only one
|
2017-12-16 17:07:29 +01:00
|
|
|
didn't).
|
|
|
|
|
2017-12-16 17:43:47 +01:00
|
|
|
20. Allocate a single callout block on the stack at the start of pcre2_match()
|
2018-01-01 18:27:55 +01:00
|
|
|
and set its never-changing fields once only. Do the same for pcre2_dfa_match().
|
2017-12-16 17:43:47 +01:00
|
|
|
|
2017-12-16 18:49:26 +01:00
|
|
|
21. Save the extra compile options (set in the compile context) with the
|
|
|
|
compiled pattern (they were not previously saved), add PCRE2_INFO_EXTRAOPTIONS
|
|
|
|
to retrieve them, and update pcre2test to show them.
|
|
|
|
|
2017-12-22 16:56:27 +01:00
|
|
|
22. Added PCRE2_CALLOUT_STARTMATCH and PCRE2_CALLOUT_BACKTRACK bits to a new
|
|
|
|
field callout_flags in callout blocks. The bits are set by pcre2_match(), but
|
|
|
|
not by JIT or pcre2_dfa_match(). Their settings are shown in pcre2test callouts
|
|
|
|
if the callout_extra subject modifier is set. These bits are provided to help
|
|
|
|
with tracking how a backtracking match is proceeding.
|
|
|
|
|
2017-12-23 18:15:51 +01:00
|
|
|
23. Updated the pcre2demo.c demonstration program, which was missing the extra
|
|
|
|
code for -g that handles the case when \K in an assertion causes the match to
|
|
|
|
end at the original start point. Also arranged for it to detect when \K causes
|
|
|
|
the end of a match to be before its start.
|
|
|
|
|
2018-01-01 15:12:35 +01:00
|
|
|
24. Similar to 23 above, strange things (including loops) could happen in
|
|
|
|
pcre2grep when \K was used in an assertion when --colour was used or in
|
|
|
|
multiline mode. The "end at original start point" bug is fixed, and if the end
|
2017-12-26 16:10:04 +01:00
|
|
|
point is found to be before the start point, they are swapped.
|
|
|
|
|
2018-01-01 15:12:35 +01:00
|
|
|
25. When PCRE2_FIRSTLINE without PCRE2_NO_START_OPTIMIZE was used in non-JIT
|
|
|
|
matching (both pcre2_match() and pcre2_dfa_match()) and the matched string
|
|
|
|
started with the first code unit of a newline sequence, matching failed because
|
2018-01-01 18:27:55 +01:00
|
|
|
it was not tried at the newline.
|
|
|
|
|
|
|
|
26. Code for giving up a non-partial match after failing to find a starting
|
|
|
|
code unit anywhere in the subject was missing when searching for one of a
|
|
|
|
number of code units (the bitmap case) in both pcre2_match() and
|
|
|
|
pcre2_dfa_match(). This was a missing optimization rather than a bug.
|
|
|
|
|
|
|
|
27. Tidied up the ACROSSCHAR macro to be like FORWARDCHAR and BACKCHAR, using a
|
|
|
|
pointer argument rather than a code unit value. This should not have affected
|
|
|
|
the generated code.
|
2018-01-01 15:12:35 +01:00
|
|
|
|
2018-01-12 19:48:27 +01:00
|
|
|
28. The JIT compiler has been updated.
|
|
|
|
|
|
|
|
29. Avoid pointer overflow for unset captures in pcre2_substring_list_get().
|
|
|
|
This could not actually cause a crash because it was always used in a memcpy()
|
|
|
|
call with zero length.
|
|
|
|
|
2018-01-16 17:50:40 +01:00
|
|
|
30. Some internal structures have a variable-length ovector[] as their last
|
|
|
|
element. Their actual memory is obtained dynamically, giving an ovector of
|
|
|
|
appropriate length. However, they are defined in the structure as
|
|
|
|
ovector[NUMBER], where NUMBER is large so that array bound checkers don't
|
2018-02-12 12:33:56 +01:00
|
|
|
grumble. The value of NUMBER was 10000, but a fuzzer exceeded 5000 capturing
|
|
|
|
groups, making the ovector larger than this. The number has been increased to
|
|
|
|
131072, which allows for the maximum number of captures (65535) plus the
|
2018-01-16 17:50:40 +01:00
|
|
|
overall match. This fixes oss-fuzz issue 5415.
|
|
|
|
|
2018-02-12 12:33:56 +01:00
|
|
|
31. Auto-possessification at the end of a capturing group was dependent on what
|
|
|
|
follows the group (e.g. /(a+)b/ would auto-possessify the a+) but this caused
|
|
|
|
incorrect behaviour when the group was called recursively from elsewhere in the
|
2018-01-31 18:53:56 +01:00
|
|
|
pattern where something different might follow. This bug is an unforseen
|
|
|
|
consequence of change #1 for 10.30 - the implementation of backtracking into
|
|
|
|
recursions. Iterators at the ends of capturing groups are no longer considered
|
2018-02-12 12:33:56 +01:00
|
|
|
for auto-possessification if the pattern contains any recursions. Fixes
|
2018-01-31 18:53:56 +01:00
|
|
|
Bugzilla #2232.
|
|
|
|
|
2017-08-28 16:59:04 +02:00
|
|
|
|
2017-08-15 12:58:32 +02:00
|
|
|
Version 10.30 14-August-2017
|
|
|
|
----------------------------
|
2017-02-23 18:05:43 +01:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
1. The main interpreter, pcre2_match(), has been refactored into a new version
|
|
|
|
that does not use recursive function calls (and therefore the stack) for
|
|
|
|
remembering backtracking positions. This makes --disable-stack-for-recursion a
|
2017-03-09 17:23:28 +01:00
|
|
|
NOOP. The new implementation allows backtracking into recursive group calls in
|
2017-07-19 18:04:15 +02:00
|
|
|
patterns, making it more compatible with Perl, and also fixes some other
|
|
|
|
hard-to-do issues such as #1887 in Bugzilla. The code is also cleaner because
|
|
|
|
the old code had a number of fudges to try to reduce stack usage. It seems to
|
2017-03-09 17:23:28 +01:00
|
|
|
run no slower than the old code.
|
|
|
|
|
2017-03-10 16:53:49 +01:00
|
|
|
A number of bugs in the refactored code were subsequently fixed during testing
|
2017-03-23 18:54:58 +01:00
|
|
|
before release, but after the code was made available in the repository. These
|
|
|
|
bugs were never in fully released code, but are noted here for the record.
|
2017-03-10 16:53:49 +01:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
(a) If a pattern had fewer capturing parentheses than the ovector supplied in
|
2017-03-10 16:53:49 +01:00
|
|
|
the match data block, a memory error (detectable by ASAN) occurred after
|
|
|
|
a match, because the external block was being set from non-existent
|
|
|
|
internal ovector fields. Fixes oss-fuzz issue 781.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
(b) A pattern with very many capturing parentheses (when the internal frame
|
|
|
|
size was greater than the initial frame vector on the stack) caused a
|
|
|
|
crash. A vector on the heap is now set up at the start of matching if the
|
|
|
|
vector on the stack is not big enough to handle at least 10 frames.
|
|
|
|
Fixes oss-fuzz issue 783.
|
|
|
|
|
2017-04-03 20:02:07 +02:00
|
|
|
(c) Handling of (*VERB)s in recursions was wrong in some cases.
|
2017-07-19 18:04:15 +02:00
|
|
|
|
2017-04-03 20:02:07 +02:00
|
|
|
(d) Captures in negative assertions that were used as conditions were not
|
2017-07-19 18:04:15 +02:00
|
|
|
happening if the assertion matched via (*ACCEPT).
|
|
|
|
|
|
|
|
(e) Mark values were not being passed out of recursions.
|
|
|
|
|
|
|
|
(f) Refactor some code in do_callout() to avoid picky compiler warnings about
|
2017-05-10 18:44:33 +02:00
|
|
|
negative indices. Fixes oss-fuzz issue 1454.
|
2017-07-19 18:04:15 +02:00
|
|
|
|
2017-05-10 20:21:03 +02:00
|
|
|
(g) Similarly refactor the way the variable length ovector is addressed for
|
|
|
|
similar reasons. Fixes oss-fuzz issue 1465.
|
2017-07-19 18:04:15 +02:00
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
2. Now that pcre2_match() no longer uses recursive function calls (see above),
|
2017-07-19 18:04:15 +02:00
|
|
|
the "match limit recursion" value seems misnamed. It still exists, and limits
|
|
|
|
the depth of tree that is searched. To avoid future confusion, it has been
|
|
|
|
renamed as "depth limit" in all relevant places (--with-depth-limit,
|
|
|
|
(*LIMIT_DEPTH), pcre2_set_depth_limit(), etc) but the old names are still
|
|
|
|
available for backwards compatibility.
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
3. Hardened pcre2test so as to reduce the number of bugs reported by fuzzers:
|
2017-02-23 18:05:43 +01:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
(a) Check for malloc failures when getting memory for the ovector (POSIX) or
|
|
|
|
the match data block (non-POSIX).
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
4. In the 32-bit library in non-UTF mode, an attempt to find a Unicode property
|
2017-02-24 19:25:32 +01:00
|
|
|
for a character with a code point greater than 0x10ffff (the Unicode maximum)
|
|
|
|
caused a crash.
|
2017-02-23 18:05:43 +01:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
5. If a lookbehind assertion that contained a back reference to a group
|
2017-03-16 18:17:47 +01:00
|
|
|
appearing later in the pattern was compiled with the PCRE2_ANCHORED option,
|
2017-07-19 18:04:15 +02:00
|
|
|
undefined actions (often a segmentation fault) could occur, depending on what
|
|
|
|
other options were set. An example assertion is (?<!\1(abc)) where the
|
2017-03-16 18:17:47 +01:00
|
|
|
reference \1 precedes the group (abc). This fixes oss-fuzz issue 865.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
6. Added the PCRE2_INFO_FRAMESIZE item to pcre2_pattern_info() and arranged for
|
2017-03-16 18:55:55 +01:00
|
|
|
pcre2test to use it to output the frame size when the "framesize" modifier is
|
|
|
|
given.
|
|
|
|
|
2017-03-19 04:35:27 +01:00
|
|
|
7. Reworked the recursive pattern matching in the JIT compiler to follow the
|
|
|
|
interpreter changes.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
8. When the zero_terminate modifier was specified on a pcre2test subject line
|
|
|
|
for global matching, unpredictable things could happen. For example, in UTF-8
|
|
|
|
mode, the pattern //g,zero_terminate read random memory when matched against an
|
2017-03-19 19:34:27 +01:00
|
|
|
empty string with zero_terminate. This was a bug in pcre2test, not the library.
|
|
|
|
|
2017-03-21 17:09:57 +01:00
|
|
|
9. Moved some Windows-specific code in pcre2grep (introduced in 10.23/13) out
|
|
|
|
of the section that is compiled when Unix-style directory scanning is
|
|
|
|
available, and into a new section that is always compiled for Windows.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
10. In pcre2test, explicitly close the file after an error during serialization
|
2017-03-21 17:18:54 +01:00
|
|
|
or deserialization (the "load" or "save" commands).
|
|
|
|
|
2017-03-21 17:25:01 +01:00
|
|
|
11. Fix memory leak in pcre2_serialize_decode() when the input is invalid.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
12. Fix potential NULL dereference in pcre2_callout_enumerate() if called with
|
2017-03-21 17:31:54 +01:00
|
|
|
a NULL pattern pointer when Unicode support is available.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
13. When the 32-bit library was being tested by pcre2test, error messages that
|
|
|
|
were longer than 64 code units could cause a buffer overflow. This was a bug in
|
2017-03-21 18:46:21 +01:00
|
|
|
pcre2test.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
14. The alternative matching function, pcre2_dfa_match() misbehaved if it
|
2017-03-22 16:12:06 +01:00
|
|
|
encountered a character class with a possessive repeat, for example [a-f]{3}+.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
15. The depth (formerly recursion) limit now applies to DFA matching (as
|
|
|
|
of 10.23/36); pcre2test has been upgraded so that \=find_limits works with DFA
|
2017-03-24 19:20:34 +01:00
|
|
|
matching to find the minimum value for this limit.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
16. Since 10.21, if pcre2_match() was called with a null context, default
|
|
|
|
memory allocation functions were used instead of whatever was used when the
|
2017-03-25 16:19:49 +01:00
|
|
|
pattern was compiled.
|
|
|
|
|
2017-03-25 18:08:20 +01:00
|
|
|
17. Changes to the pcre2test "memory" modifier on a subject line. These apply
|
|
|
|
only to pcre2_match():
|
|
|
|
|
|
|
|
(a) Warn if null_context is set on both pattern and subject, because the
|
|
|
|
memory details cannot then be shown.
|
2017-07-19 18:04:15 +02:00
|
|
|
|
2017-03-25 18:08:20 +01:00
|
|
|
(b) Remember (up to a certain number of) memory allocations and their
|
|
|
|
lengths, and list only the lengths, so as to be system-independent.
|
2017-07-19 18:04:15 +02:00
|
|
|
(In practice, the new interpreter never has more than 2 blocks allocated
|
|
|
|
simultaneously.)
|
|
|
|
|
2017-03-26 19:51:31 +02:00
|
|
|
18. Make pcre2test detect an error return from pcre2_get_error_message(), give
|
2017-07-19 18:04:15 +02:00
|
|
|
a message, and abandon the run (this would have detected #13 above).
|
2017-03-25 18:08:20 +01:00
|
|
|
|
2017-04-04 19:09:33 +02:00
|
|
|
19. Implemented PCRE2_ENDANCHORED.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
20. Applied Jason Hood's patches (slightly modified) to pcre2grep, to implement
|
2017-04-06 20:02:40 +02:00
|
|
|
the --output=text (-O) option and the inbuilt callout echo.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
21. Extend auto-anchoring etc. to ignore groups with a zero qualifier and
|
|
|
|
single-branch conditions with a false condition (e.g. DEFINE) at the start of a
|
2017-04-07 10:46:29 +02:00
|
|
|
branch. For example, /(?(DEFINE)...)^A/ and /(...){0}^B/ are now flagged as
|
|
|
|
anchored.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
22. Added an explicit limit on the amount of heap used by pcre2_match(), set by
|
|
|
|
pcre2_set_heap_limit() or (*LIMIT_HEAP=xxx). Upgraded pcre2test to show the
|
|
|
|
heap limit along with other pattern information, and to find the minimum when
|
2017-04-11 13:47:25 +02:00
|
|
|
the find_limits modifier is set.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
23. Write to the last 8 bytes of the pcre2_real_code structure when a compiled
|
|
|
|
pattern is set up so as to initialize any padding the compiler might have
|
|
|
|
included. This avoids valgrind warnings when a compiled pattern is copied, in
|
2017-04-12 15:48:11 +02:00
|
|
|
particular when it is serialized.
|
|
|
|
|
2017-04-14 13:42:02 +02:00
|
|
|
24. Remove a redundant line of code left in accidentally a long time ago.
|
|
|
|
|
2017-04-14 14:08:54 +02:00
|
|
|
25. Remove a duplication typo in pcre2_tables.c
|
|
|
|
|
2017-04-14 14:14:41 +02:00
|
|
|
26. Correct an incorrect cast in pcre2_valid_utf.c
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
27. Update pcre2test, remove some unused code in pcre2_match(), and upgrade the
|
2017-04-16 15:03:30 +02:00
|
|
|
tests to improve coverage.
|
|
|
|
|
2017-04-16 18:49:11 +02:00
|
|
|
28. Some fixes/tidies as a result of looking at Coverity Scan output:
|
|
|
|
|
|
|
|
(a) Typo: ">" should be ">=" in opcode check in pcre2_auto_possess.c.
|
2017-07-19 18:04:15 +02:00
|
|
|
(b) Added some casts to avoid "suspicious implicit sign extension".
|
|
|
|
(c) Resource leaks in pcre2test in rare error cases.
|
2017-04-16 18:49:11 +02:00
|
|
|
(d) Avoid warning for never-use case OP_TABLE_LENGTH which is just a fudge
|
2017-07-19 18:04:15 +02:00
|
|
|
for checking at compile time that tables are the right size.
|
|
|
|
(e) Add missing "fall through" comment.
|
|
|
|
|
|
|
|
29. Implemented PCRE2_EXTENDED_MORE and related /xx and (?xx) features.
|
2017-04-16 18:49:11 +02:00
|
|
|
|
2017-04-18 18:21:50 +02:00
|
|
|
30. Implement (?n: for PCRE2_NO_AUTO_CAPTURE, because Perl now has this.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
31. If more than one of "push", "pushcopy", or "pushtablescopy" were set in
|
2017-05-06 18:56:07 +02:00
|
|
|
pcre2test, a crash could occur.
|
|
|
|
|
2018-06-18 18:49:12 +02:00
|
|
|
32. Make -bigstack in RunTest allocate a 64MiB stack (instead of 16MiB) so
|
2018-06-18 16:03:33 +02:00
|
|
|
that all the tests can run with clang's sanitizing options.
|
2017-05-10 20:21:03 +02:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
33. Implement extra compile options in the compile context and add the first
|
2017-05-17 19:55:11 +02:00
|
|
|
one: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES.
|
|
|
|
|
2017-05-26 19:14:36 +02:00
|
|
|
34. Implement newline type PCRE2_NEWLINE_NUL.
|
2017-02-23 18:05:43 +01:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
35. A lookbehind assertion that had a zero-length branch caused undefined
|
2017-05-27 17:49:29 +02:00
|
|
|
behaviour when processed by pcre2_dfa_match(). This is oss-fuzz issue 1859.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
36. The match limit value now also applies to pcre2_dfa_match() as there are
|
|
|
|
patterns that can use up a lot of resources without necessarily recursing very
|
2017-05-30 12:42:57 +02:00
|
|
|
deeply. (Compare item 10.23/36.) This should fix oss-fuzz #1761.
|
|
|
|
|
2017-06-02 09:25:56 +02:00
|
|
|
37. Implement PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
38. Fix returned offsets from regexec() when REG_STARTEND is used with a
|
2017-06-03 18:42:58 +02:00
|
|
|
starting offset greater than zero.
|
|
|
|
|
2017-06-05 20:25:47 +02:00
|
|
|
39. Implement REG_PEND (GNU extension) for the POSIX wrapper.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
40. Implement the subject_literal modifier in pcre2test, and allow jitstack on
|
2017-06-12 19:48:03 +02:00
|
|
|
pattern lines.
|
|
|
|
|
2017-06-15 18:41:44 +02:00
|
|
|
41. Implement PCRE2_LITERAL and use it to support REG_NOSPEC.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
42. Implement PCRE2_EXTRA_MATCH_LINE and PCRE2_EXTRA_MATCH_WORD for the benefit
|
2017-06-16 19:51:13 +02:00
|
|
|
of pcre2grep.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
43. Re-implement pcre2grep's -F, -w, and -x options using PCRE2_LITERAL,
|
2017-06-17 13:32:06 +02:00
|
|
|
PCRE2_EXTRA_MATCH_WORD, and PCRE2_EXTRA_MATCH_LINE. This fixes two bugs:
|
|
|
|
|
|
|
|
(a) The -F option did not work for fixed strings containing \E.
|
2017-07-19 18:04:15 +02:00
|
|
|
(b) The -w option did not work for patterns with multiple branches.
|
|
|
|
|
2017-06-17 17:36:22 +02:00
|
|
|
44. Added configuration options for the SELinux compatible execmem allocator in
|
|
|
|
JIT.
|
2017-06-17 13:32:06 +02:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
45. Increased the limit for searching for a "must be present" code unit in
|
|
|
|
subjects from 1000 to 2000 for 8-bit searches, since they use memchr() and are
|
2017-06-26 18:25:16 +02:00
|
|
|
much faster.
|
|
|
|
|
2017-06-30 18:00:33 +02:00
|
|
|
46. Arrange for anchored patterns to record and use "first code unit" data,
|
2017-07-19 18:04:15 +02:00
|
|
|
because this can give a fast "no match" without searching for a "required code
|
2017-06-30 18:00:33 +02:00
|
|
|
unit". Previously only non-anchored patterns did this.
|
|
|
|
|
2017-07-02 18:32:01 +02:00
|
|
|
47. Upgraded the Unicode tables from Unicode 8.0.0 to Unicode 10.0.0.
|
|
|
|
|
|
|
|
48. Add the callout_no_where modifier to pcre2test.
|
2017-06-30 18:00:33 +02:00
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
49. Update extended grapheme breaking rules to the latest set that are in
|
2017-07-05 10:55:49 +02:00
|
|
|
Unicode Standard Annex #29.
|
|
|
|
|
2017-07-19 18:04:15 +02:00
|
|
|
50. Added experimental foreign pattern conversion facilities
|
2017-07-12 18:34:49 +02:00
|
|
|
(pcre2_pattern_convert() and friends).
|
|
|
|
|
2017-07-29 17:54:04 +02:00
|
|
|
51. Change the macro FWRITE, used in pcre2grep, to FWRITE_IGNORE because FWRITE
|
|
|
|
is defined in a system header in cygwin. Also modified some of the #ifdefs in
|
2017-07-27 18:17:19 +02:00
|
|
|
pcre2grep related to Windows and Cygwin support.
|
2017-07-21 10:22:03 +02:00
|
|
|
|
2017-07-29 17:54:04 +02:00
|
|
|
52. Change 3(g) for 10.23 was a bit too zealous. If a hyphen that follows a
|
|
|
|
character class is the last character in the class, Perl does not give a
|
|
|
|
warning. PCRE2 now also treats this as a literal.
|
|
|
|
|
|
|
|
53. Related to 52, though PCRE2 was throwing an error for [[:digit:]-X] it was
|
|
|
|
not doing so for [\d-X] (and similar escapes), as is documented.
|
|
|
|
|
2017-08-01 10:26:01 +02:00
|
|
|
54. Fixed a MIPS issue in the JIT compiler reported by Joshua Kinard.
|
|
|
|
|
2017-08-15 12:58:32 +02:00
|
|
|
55. Fixed a "maybe uninitialized" warning for class_uchardata in \p handling in
|
2017-08-12 18:22:52 +02:00
|
|
|
pcre2_compile() which could never actually trigger (code should have been cut
|
|
|
|
out when Unicode support is disabled).
|
2017-08-01 10:26:01 +02:00
|
|
|
|
2017-05-10 18:44:33 +02:00
|
|
|
|
2017-02-14 11:29:00 +01:00
|
|
|
Version 10.23 14-February-2017
|
|
|
|
------------------------------
|
2016-08-03 11:01:02 +02:00
|
|
|
|
|
|
|
1. Extended pcre2test with the utf8_input modifier so that it is able to
|
|
|
|
generate all possible 16-bit and 32-bit code unit values in non-UTF modes.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
2. In any wide-character mode (8-bit UTF or any 16-bit or 32-bit mode), without
|
|
|
|
PCRE2_UCP set, a negative character type such as \D in a positive class should
|
2016-08-03 19:22:59 +02:00
|
|
|
cause all characters greater than 255 to match, whatever else is in the class.
|
|
|
|
There was a bug that caused this not to happen if a Unicode property item was
|
|
|
|
added to such a class, for example [\D\P{Nd}] or [\W\pL].
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
3. There has been a major re-factoring of the pcre2_compile.c file. Most syntax
|
|
|
|
checking is now done in the pre-pass that identifies capturing groups. This has
|
|
|
|
reduced the amount of duplication and made the code tidier. While doing this,
|
2016-10-02 18:01:01 +02:00
|
|
|
some minor bugs and Perl incompatibilities were fixed, including:
|
|
|
|
|
|
|
|
(a) \Q\E in the middle of a quantifier such as A+\Q\E+ is now ignored instead
|
|
|
|
of giving an invalid quantifier error.
|
2016-11-01 18:45:54 +01:00
|
|
|
|
2016-10-02 18:01:01 +02:00
|
|
|
(b) {0} can now be used after a group in a lookbehind assertion; previously
|
|
|
|
this caused an "assertion is not fixed length" error.
|
2016-11-01 18:45:54 +01:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(c) Perl always treats (?(DEFINE) as a "define" group, even if a group with
|
2016-10-02 18:01:01 +02:00
|
|
|
the name "DEFINE" exists. PCRE2 now does likewise.
|
2016-11-01 18:45:54 +01:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(d) A recursion condition test such as (?(R2)...) must now refer to an
|
2016-10-02 18:01:01 +02:00
|
|
|
existing subpattern.
|
2016-11-01 18:45:54 +01:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(e) A conditional recursion test such as (?(R)...) misbehaved if there was a
|
2016-10-13 18:08:08 +02:00
|
|
|
group whose name began with "R".
|
2016-11-01 18:45:54 +01:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(f) When testing zero-terminated patterns under valgrind, the terminating
|
2016-11-01 18:45:54 +01:00
|
|
|
zero is now marked "no access". This catches bugs that would otherwise
|
|
|
|
show up only with non-zero-terminated patterns.
|
2017-01-16 18:40:47 +01:00
|
|
|
|
|
|
|
(g) A hyphen appearing immediately after a POSIX character class (for example
|
|
|
|
/[[:ascii:]-z]/) now generates an error. Perl does accept this as a
|
|
|
|
literal, but gives a warning, so it seems best to fail it in PCRE.
|
|
|
|
|
|
|
|
(h) An empty \Q\E sequence may appear after a callout that precedes an
|
2016-12-28 13:26:12 +01:00
|
|
|
assertion condition (it is, of course, ignored).
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
One effect of the refactoring is that some error numbers and messages have
|
2016-10-02 18:01:01 +02:00
|
|
|
changed, and the pattern offset given for compiling errors is not always the
|
|
|
|
right-most character that has been read. In particular, for a variable-length
|
|
|
|
lookbehind assertion it now points to the start of the assertion. Another
|
|
|
|
change is that when a callout appears before a group, the "length of next
|
|
|
|
pattern item" that is passed now just gives the length of the opening
|
|
|
|
parenthesis item, not the length of the whole group. A length of zero is now
|
2016-12-11 17:47:39 +01:00
|
|
|
given only for a callout at the end of the pattern. Automatic callouts are no
|
2016-10-02 18:01:01 +02:00
|
|
|
longer inserted before and after explicit callouts in the pattern.
|
|
|
|
|
2016-12-24 17:25:11 +01:00
|
|
|
A number of bugs in the refactored code were subsequently fixed during testing
|
|
|
|
before release, but after the code was made available in the repository. Many
|
|
|
|
of the bugs were discovered by fuzzing testing. Several of them were related to
|
|
|
|
the change from assuming a zero-terminated pattern (which previously had
|
|
|
|
required non-zero terminated strings to be copied). These bugs were never in
|
|
|
|
fully released code, but are noted here for the record.
|
2016-10-26 18:59:22 +02:00
|
|
|
|
|
|
|
(a) An overall recursion such as (?0) inside a lookbehind assertion was not
|
|
|
|
being diagnosed as an error.
|
|
|
|
|
|
|
|
(b) In utf mode, the length of a *MARK (or other verb) name was being checked
|
2016-12-11 17:47:39 +01:00
|
|
|
in characters instead of code units, which could lead to bad code being
|
|
|
|
compiled, leading to unpredictable behaviour.
|
|
|
|
|
2016-10-27 19:42:14 +02:00
|
|
|
(c) In extended /x mode, characters whose code was greater than 255 caused
|
2016-12-11 17:47:39 +01:00
|
|
|
a lookup outside one of the global tables. A similar bug existed for wide
|
|
|
|
characters in *VERB names.
|
2016-10-26 18:59:22 +02:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(d) The amount of memory needed for a compiled pattern was miscalculated if a
|
|
|
|
lookbehind contained more than one toplevel branch and the first branch
|
2016-11-01 16:58:28 +01:00
|
|
|
was of length zero.
|
|
|
|
|
|
|
|
(e) In UTF-8 or UTF-16 modes with PCRE2_EXTENDED (/x) set and a non-zero-
|
|
|
|
terminated pattern, if a # comment ran on to the end of the pattern, one
|
|
|
|
or more code units past the end were being read.
|
|
|
|
|
|
|
|
(f) An unterminated repeat at the end of a non-zero-terminated pattern (e.g.
|
|
|
|
"{2,2") could cause reading beyond the pattern.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
(g) When reading a callout string, if the end delimiter was at the end of the
|
2016-11-01 18:45:54 +01:00
|
|
|
pattern one further code unit was read.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
(h) An unterminated number after \g' could cause reading beyond the pattern.
|
|
|
|
|
|
|
|
(i) An insufficient memory size was being computed for compiling with
|
|
|
|
PCRE2_AUTO_CALLOUT.
|
|
|
|
|
|
|
|
(j) A conditional group with an assertion condition used more memory than was
|
|
|
|
allowed for it during parsing, so too many of them could therefore
|
2016-11-18 19:59:37 +01:00
|
|
|
overrun a buffer.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
(k) If parsing a pattern exactly filled the buffer, the internal test for
|
2016-11-18 19:59:37 +01:00
|
|
|
overrun did not check when the final META_END item was added.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
(l) If a lookbehind contained a subroutine call, and the called group
|
|
|
|
contained an option setting such as (?s), and the PCRE2_ANCHORED option
|
|
|
|
was set, unpredictable behaviour could occur. The underlying bug was
|
|
|
|
incorrect code and insufficient checking while searching for the end of
|
2016-11-23 18:17:57 +01:00
|
|
|
the called subroutine in the parsed pattern.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
2016-11-25 11:37:23 +01:00
|
|
|
(m) Quantifiers following (*VERB)s were not being diagnosed as errors.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
(n) The use of \Q...\E in a (*VERB) name when PCRE2_ALT_VERBNAMES and
|
2016-11-27 17:14:33 +01:00
|
|
|
PCRE2_AUTO_CALLOUT were both specified caused undetermined behaviour.
|
2016-11-01 16:58:28 +01:00
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
(o) If \Q was preceded by a quantified item, and the following \E was
|
|
|
|
followed by '?' or '+', and there was at least one literal character
|
|
|
|
between them, an internal error "unexpected repeat" occurred (example:
|
|
|
|
/.+\QX\E+/).
|
2016-12-24 17:25:11 +01:00
|
|
|
|
|
|
|
(p) A buffer overflow could occur while sorting the names in the group name
|
|
|
|
list (depending on the order in which the names were seen).
|
|
|
|
|
2016-12-23 19:34:10 +01:00
|
|
|
(q) A conditional group that started with a callout was not doing the right
|
|
|
|
check for a following assertion, leading to compiling bad code. Example:
|
2016-12-24 17:25:11 +01:00
|
|
|
/(?(C'XX))?!XX/
|
|
|
|
|
|
|
|
(r) If a character whose code point was greater than 0xffff appeared within
|
|
|
|
a lookbehind that was within another lookbehind, the calculation of the
|
|
|
|
lookbehind length went wrong and could provoke an internal error.
|
2017-01-16 18:40:47 +01:00
|
|
|
|
2017-01-11 17:40:35 +01:00
|
|
|
(t) The sequence \E- or \Q\E- after a POSIX class in a character class caused
|
2017-01-16 18:40:47 +01:00
|
|
|
an internal error. Now the hyphen is treated as a literal.
|
2016-12-11 17:47:39 +01:00
|
|
|
|
|
|
|
4. Back references are now permitted in lookbehind assertions when there are
|
|
|
|
no duplicated group numbers (that is, (?| has not been used), and, if the
|
2016-10-02 18:01:01 +02:00
|
|
|
reference is by name, there is only one group of that name. The referenced
|
|
|
|
group must, of course be of fixed length.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
5. pcre2test has been upgraded so that, when run under valgrind with valgrind
|
|
|
|
support enabled, reading past the end of the pattern is detected, both when
|
2016-10-02 18:01:01 +02:00
|
|
|
compiling and during callout processing.
|
|
|
|
|
2016-12-29 16:54:23 +01:00
|
|
|
6. \g{+<number>} (e.g. \g{+2} ) is now supported. It is a "forward back
|
|
|
|
reference" and can be useful in repetitions (compare \g{-<number>} ). Perl does
|
2016-10-02 18:01:01 +02:00
|
|
|
not recognize this syntax.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
7. Automatic callouts are no longer generated before and after callouts in the
|
2016-10-02 18:01:01 +02:00
|
|
|
pattern.
|
|
|
|
|
2016-10-05 18:53:34 +02:00
|
|
|
8. When pcre2test was outputing information from a callout, the caret indicator
|
|
|
|
for the current position in the subject line was incorrect if it was after an
|
|
|
|
escape sequence for a character whose code point was greater than \x{ff}.
|
|
|
|
|
2016-10-05 19:03:52 +02:00
|
|
|
9. Change 19 for 10.22 had a typo (PCRE_STATIC_RUNTIME should be
|
|
|
|
PCRE2_STATIC_RUNTIME). Fix from David Gaussmann.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
10. Added --max-buffer-size to pcre2grep, to allow for automatic buffer
|
|
|
|
expansion when long lines are encountered. Original patch by Dmitry
|
2016-10-11 18:40:09 +02:00
|
|
|
Cherniachenko.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
11. If pcre2grep was compiled with JIT support, but the library was compiled
|
2016-10-13 19:20:08 +02:00
|
|
|
without it (something that neither ./configure nor CMake allow, but it can be
|
|
|
|
done by editing config.h), pcre2grep was giving a JIT error. Now it detects
|
|
|
|
this situation and does not try to use JIT.
|
|
|
|
|
2016-10-14 17:47:27 +02:00
|
|
|
12. Added some "const" qualifiers to variables in pcre2grep.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
13. Added Dmitry Cherniachenko's patch for colouring output in Windows
|
|
|
|
(untested by me). Also, look for GREP_COLOUR or GREP_COLOR if the environment
|
2016-10-14 18:17:48 +02:00
|
|
|
variables PCRE2GREP_COLOUR and PCRE2GREP_COLOR are not found.
|
|
|
|
|
2016-10-16 18:48:14 +02:00
|
|
|
14. Add the -t (grand total) option to pcre2grep.
|
|
|
|
|
2016-10-18 13:22:40 +02:00
|
|
|
15. A number of bugs have been mended relating to match start-up optimizations
|
|
|
|
when the first thing in a pattern is a positive lookahead. These all applied
|
|
|
|
only when PCRE2_NO_START_OPTIMIZE was *not* set:
|
|
|
|
|
|
|
|
(a) A pattern such as (?=.*X)X$ was incorrectly optimized as if it needed
|
|
|
|
both an initial 'X' and a following 'X'.
|
|
|
|
(b) Some patterns starting with an assertion that started with .* were
|
|
|
|
incorrectly optimized as having to match at the start of the subject or
|
|
|
|
after a newline. There are cases where this is not true, for example,
|
|
|
|
(?=.*[A-Z])(?=.{8,16})(?!.*[\s]) matches after the start in lines that
|
2016-12-11 17:47:39 +01:00
|
|
|
start with spaces. Starting .* in an assertion is no longer taken as an
|
|
|
|
indication of matching at the start (or after a newline).
|
|
|
|
|
2016-10-23 18:18:15 +02:00
|
|
|
16. The "offset" modifier in pcre2test was not being ignored (as documented)
|
|
|
|
when the POSIX API was in use.
|
2016-10-18 13:22:40 +02:00
|
|
|
|
2016-10-31 18:19:00 +01:00
|
|
|
17. Added --enable-fuzz-support to "configure", causing an non-installed
|
2016-10-31 18:46:56 +01:00
|
|
|
library containing a test function that can be called by fuzzers to be
|
|
|
|
compiled. A non-installed binary to run the test function locally, called
|
|
|
|
pcre2fuzzcheck is also compiled.
|
|
|
|
|
2016-11-01 16:58:28 +01:00
|
|
|
18. A pattern with PCRE2_DOTALL (/s) set but not PCRE2_NO_DOTSTAR_ANCHOR, and
|
|
|
|
which started with .* inside a positive lookahead was incorrectly being
|
|
|
|
compiled as implicitly anchored.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
19. Removed all instances of "register" declarations, as they are considered
|
2016-11-03 18:35:59 +01:00
|
|
|
obsolete these days and in any case had become very haphazard.
|
|
|
|
|
2016-11-03 19:18:53 +01:00
|
|
|
20. Add strerror() to pcre2test for failed file opening.
|
|
|
|
|
2016-11-03 19:25:51 +01:00
|
|
|
21. Make pcre2test -C list valgrind support when it is enabled.
|
|
|
|
|
2016-11-04 11:53:43 +01:00
|
|
|
22. Add the use_length modifier to pcre2test.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
23. Fix an off-by-one bug in pcre2test for the list of names for 'get' and
|
2016-11-10 18:08:27 +01:00
|
|
|
'copy' modifiers.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
24. Add PCRE2_CALL_CONVENTION into the prototype declarations in pcre2.h as it
|
|
|
|
is apparently needed there as well as in the function definitions. (Why did
|
2016-11-19 13:46:24 +01:00
|
|
|
nobody ask for this in PCRE1?)
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
25. Change the _PCRE2_H and _PCRE2_UCP_H guard macros in the header files to
|
|
|
|
PCRE2_H_IDEMPOTENT_GUARD and PCRE2_UCP_H_IDEMPOTENT_GUARD to be more standard
|
2016-11-20 13:46:11 +01:00
|
|
|
compliant and unique.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
26. pcre2-config --libs-posix was listing -lpcre2posix instead of
|
|
|
|
-lpcre2-posix. Also, the CMake build process was building the library with the
|
2016-11-22 11:18:08 +01:00
|
|
|
wrong name.
|
|
|
|
|
2016-11-22 11:33:13 +01:00
|
|
|
27. In pcre2test, give some offset information for errors in hex patterns.
|
2017-02-14 11:40:33 +01:00
|
|
|
This uses the C99 formatting sequence %td, except for MSVC which doesn't
|
2017-02-04 17:27:20 +01:00
|
|
|
support it - %lu is used instead.
|
2016-11-22 11:33:13 +01:00
|
|
|
|
2016-11-22 16:37:02 +01:00
|
|
|
28. Implemented pcre2_code_copy_with_tables(), and added pushtablescopy to
|
|
|
|
pcre2test for testing it.
|
|
|
|
|
2016-12-08 17:52:26 +01:00
|
|
|
29. Fix small memory leak in pcre2test.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
30. Fix out-of-bounds read for partial matching of /./ against an empty string
|
2016-12-08 18:55:26 +01:00
|
|
|
when the newline type is CRLF.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
31. Fix a bug in pcre2test that caused a crash when a locale was set either in
|
2016-12-08 19:56:24 +01:00
|
|
|
the current pattern or a previous one and a wide character was matched.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
32. The appearance of \p, \P, or \X in a substitution string when
|
|
|
|
PCRE2_SUBSTITUTE_EXTENDED was set caused a segmentation fault (NULL
|
2016-12-09 17:57:51 +01:00
|
|
|
dereference).
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
33. If the starting offset was specified as greater than the subject length in
|
2016-12-09 19:19:38 +01:00
|
|
|
a call to pcre2_substitute() an out-of-bounds memory reference could occur.
|
|
|
|
|
2016-12-11 17:47:39 +01:00
|
|
|
34. When PCRE2 was compiled to use the heap instead of the stack for recursive
|
|
|
|
calls to match(), a repeated minimizing caseless back reference, or a
|
|
|
|
maximizing one where the two cases had different numbers of code units,
|
|
|
|
followed by a caseful back reference, could lose the caselessness of the first
|
|
|
|
repeated back reference (example: /(Z)(a)\2{1,2}?(?-i)\1X/i should match ZaAAZX
|
2016-12-10 15:59:24 +01:00
|
|
|
but didn't).
|
|
|
|
|
2016-12-24 17:25:11 +01:00
|
|
|
35. When a pattern is too complicated, PCRE2 gives up trying to find a minimum
|
2016-12-20 17:47:41 +01:00
|
|
|
matching length and just records zero. Typically this happens when there are
|
|
|
|
too many nested or recursive back references. If the limit was reached in
|
2016-12-24 17:25:11 +01:00
|
|
|
certain recursive cases it failed to be triggered and an internal error could
|
2016-12-20 17:47:41 +01:00
|
|
|
be the result.
|
|
|
|
|
2016-12-24 17:25:11 +01:00
|
|
|
36. The pcre2_dfa_match() function now takes note of the recursion limit for
|
|
|
|
the internal recursive calls that are used for lookrounds and recursions within
|
2016-12-23 12:04:51 +01:00
|
|
|
the pattern.
|
|
|
|
|
2016-12-23 18:09:37 +01:00
|
|
|
37. More refactoring has got rid of the internal could_be_empty_branch()
|
|
|
|
function (around 400 lines of code, including comments) by keeping track of
|
2016-12-24 17:25:11 +01:00
|
|
|
could-be-emptiness as the pattern is compiled instead of scanning compiled
|
2016-12-23 18:09:37 +01:00
|
|
|
groups. (This would have been much harder before the refactoring of #3 above.)
|
2016-12-24 17:25:11 +01:00
|
|
|
This lifts a restriction on the number of branches in a group (more than about
|
2016-12-23 18:09:37 +01:00
|
|
|
1100 would give "pattern is too complicated").
|
|
|
|
|
2016-12-24 17:25:11 +01:00
|
|
|
38. Add the "-ac" command line option to pcre2test as a synonym for "-pattern
|
2016-12-23 18:36:22 +01:00
|
|
|
auto_callout".
|
|
|
|
|
2016-12-26 18:11:18 +01:00
|
|
|
39. In a library with Unicode support, incorrect data was compiled for a
|
|
|
|
pattern with PCRE2_UCP set without PCRE2_UTF if a class required all wide
|
|
|
|
characters to match (for example, /[\s[:^ascii:]]/).
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
40. The callout_error modifier has been added to pcre2test to make it possible
|
2016-12-28 16:05:48 +01:00
|
|
|
to return PCRE2_ERROR_CALLOUT from a callout.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
41. A minor change to pcre2grep: colour reset is now "<esc>[0m" instead of
|
2016-12-29 17:29:05 +01:00
|
|
|
"<esc>[00m".
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
42. The limit in the auto-possessification code that was intended to catch
|
|
|
|
overly-complicated patterns and not spend too much time auto-possessifying was
|
2016-12-31 14:35:31 +01:00
|
|
|
being reset too often, resulting in very long compile times for some patterns.
|
|
|
|
Now such patterns are no longer completely auto-possessified.
|
|
|
|
|
2016-12-31 15:04:25 +01:00
|
|
|
43. Applied Jason Hood's revised patch for RunTest.bat.
|
|
|
|
|
2016-12-31 15:12:53 +01:00
|
|
|
44. Added a new Windows script RunGrepTest.bat, courtesy of Jason Hood.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
45. Minor cosmetic fix to pcre2test: move a variable that is not used under
|
2016-12-31 15:17:14 +01:00
|
|
|
Windows into the "not Windows" code.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
46. Applied Jason Hood's patches to upgrade pcre2grep under Windows and tidy
|
2016-12-31 18:40:45 +01:00
|
|
|
some of the code:
|
|
|
|
|
|
|
|
* normalised the Windows condition by ensuring WIN32 is defined;
|
|
|
|
* enables the callout feature under Windows;
|
|
|
|
* adds globbing (Microsoft's implementation expands quoted args),
|
|
|
|
using a tweaked opendirectory;
|
|
|
|
* implements the is_*_tty functions for Windows;
|
|
|
|
* --color=always will write the ANSI sequences to file;
|
|
|
|
* add sequences 4 (underline works on Win10) and 5 (blink as bright
|
|
|
|
background, relatively standard on DOS/Win);
|
|
|
|
* remove the (char *) casts for the now-const strings;
|
|
|
|
* remove GREP_COLOUR (grep's command line allowed the 'u', but not
|
|
|
|
the environment), parsing GREP_COLORS instead;
|
|
|
|
* uses the current colour if not set, rather than black;
|
|
|
|
* add print_match for the undefined case;
|
|
|
|
* fixes a typo.
|
|
|
|
|
|
|
|
In addition, colour settings containing anything other than digits and
|
2017-01-16 18:40:47 +01:00
|
|
|
semicolon are ignored, and the colour controls are no longer output for empty
|
2016-12-31 18:40:45 +01:00
|
|
|
strings.
|
|
|
|
|
2017-01-03 12:35:26 +01:00
|
|
|
47. Detecting patterns that are too large inside the length-measuring loop
|
|
|
|
saves processing ridiculously long patterns to their end.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
48. Ignore PCRE2_CASELESS when processing \h, \H, \v, and \V in classes as it
|
2017-01-03 19:17:31 +01:00
|
|
|
just wastes time. In the UTF case it can also produce redundant entries in
|
|
|
|
XCLASS lists caused by characters with multiple other cases and pairs of
|
|
|
|
characters in the same "not-x" sublists.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
49. A pattern such as /(?=(a\K))/ can report the end of the match being before
|
|
|
|
its start; pcre2test was not handling this correctly when using the POSIX
|
2017-01-11 18:02:27 +01:00
|
|
|
interface (it was OK with the native interface).
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
50. In pcre2grep, ignore all JIT compile errors. This means that pcre2grep will
|
|
|
|
continue to work, falling back to interpretation if anything goes wrong with
|
2017-01-11 18:10:28 +01:00
|
|
|
JIT.
|
|
|
|
|
2017-01-16 18:40:47 +01:00
|
|
|
51. Applied patches from Christian Persch to configure.ac to make use of the
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS macro and to test for functions used by the JIT
|
2017-01-12 17:35:43 +01:00
|
|
|
modules.
|
|
|
|
|
2017-02-04 17:27:20 +01:00
|
|
|
52. Minor fixes to pcre2grep from Jason Hood:
|
2017-01-31 18:15:30 +01:00
|
|
|
* fixed some spacing;
|
2017-01-16 16:06:57 +01:00
|
|
|
* Windows doesn't usually use single quotes, so I've added a define
|
|
|
|
to use appropriate quotes [in an example];
|
|
|
|
* LC_ALL was displayed as "LCC_ALL";
|
2017-02-04 17:27:20 +01:00
|
|
|
* numbers 11, 12 & 13 should end in "th";
|
|
|
|
* use double quotes in usage message.
|
2017-02-14 11:40:33 +01:00
|
|
|
|
|
|
|
53. When autopossessifying, skip empty branches without recursion, to reduce
|
|
|
|
stack usage for the benefit of clang with -fsanitize-address, which uses huge
|
|
|
|
stack frames. Example pattern: /X?(R||){3335}/. Fixes oss-fuzz issue 553.
|
|
|
|
|
|
|
|
54. A pattern with very many explicit back references to a group that is a long
|
|
|
|
way from the start of the pattern could take a long time to compile because
|
|
|
|
searching for the referenced group in order to find the minimum length was
|
|
|
|
being done repeatedly. Now up to 128 group minimum lengths are cached and the
|
|
|
|
attempt to find a minimum length is abandoned if there is a back reference to a
|
|
|
|
group whose number is greater than 128. (In that case, the pattern is so
|
|
|
|
complicated that this optimization probably isn't worth it.) This fixes
|
2017-02-10 17:33:15 +01:00
|
|
|
oss-fuzz issue 557.
|
|
|
|
|
2017-02-14 11:40:33 +01:00
|
|
|
55. Issue 32 for 10.22 below was not correctly fixed. If pcre2grep in multiline
|
|
|
|
mode with --only-matching matched several lines, it restarted scanning at the
|
|
|
|
next line instead of moving on to the end of the matched string, which can be
|
2017-02-10 18:39:29 +01:00
|
|
|
several lines after the start.
|
|
|
|
|
2017-02-14 11:29:00 +01:00
|
|
|
56. Applied Jason Hood's new patch for RunGrepTest.bat that updates it in line
|
|
|
|
with updates to the non-Windows version.
|
|
|
|
|
|
|
|
|
2016-08-03 11:01:02 +02:00
|
|
|
|
2016-07-27 20:00:12 +02:00
|
|
|
Version 10.22 29-July-2016
|
2016-06-29 18:43:32 +02:00
|
|
|
--------------------------
|
2016-01-29 16:01:17 +01:00
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
1. Applied Jason Hood's patches to RunTest.bat and testdata/wintestoutput3
|
2016-01-29 16:01:17 +01:00
|
|
|
to fix problems with running the tests under Windows.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
2. Implemented a facility for quoting literal characters within hexadecimal
|
|
|
|
patterns in pcre2test, to make it easier to create patterns with just a few
|
2016-01-29 19:16:59 +01:00
|
|
|
non-printing characters.
|
|
|
|
|
|
|
|
3. Binary zeros are not supported in pcre2test input files. It now detects them
|
|
|
|
and gives an error.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
4. Updated the valgrind parameters in RunTest: (a) changed smc-check=all to
|
|
|
|
smc-check=all-non-file; (b) changed obj:* in the suppression file to obj:??? so
|
2016-01-30 16:19:48 +01:00
|
|
|
that it matches only unknown objects.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
5. Updated the maintenance script maint/ManyConfigTests to make it easier to
|
2016-01-30 17:00:55 +01:00
|
|
|
select individual groups of tests.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
6. When the POSIX wrapper function regcomp() is called, the REG_NOSUB option
|
2016-01-31 20:14:15 +01:00
|
|
|
used to set PCRE2_NO_AUTO_CAPTURE when calling pcre2_compile(). However, this
|
|
|
|
disables the use of back references (and subroutine calls), which are supported
|
|
|
|
by other implementations of regcomp() with RE_NOSUB. Therefore, REG_NOSUB no
|
2016-06-29 18:52:05 +02:00
|
|
|
longer causes PCRE2_NO_AUTO_CAPTURE to be set, though it still ignores nmatch
|
2016-01-31 20:14:15 +01:00
|
|
|
and pmatch when regexec() is called.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
7. Because of 6 above, pcre2test has been modified with a new modifier called
|
|
|
|
posix_nosub, to call regcomp() with REG_NOSUB. Previously the no_auto_capture
|
|
|
|
modifier had this effect. That option is now ignored when the POSIX API is in
|
2016-01-31 20:14:15 +01:00
|
|
|
use.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
8. Minor tidies to the pcre2demo.c sample program, including more comments
|
2016-02-02 17:25:47 +01:00
|
|
|
about its 8-bit-ness.
|
|
|
|
|
2016-02-02 18:22:55 +01:00
|
|
|
9. Detect unmatched closing parentheses and give the error in the pre-scan
|
|
|
|
instead of later. Previously the pre-scan carried on and could give a
|
|
|
|
misleading incorrect error message. For example, /(?J)(?'a'))(?'a')/ gave a
|
|
|
|
message about invalid duplicate group names.
|
|
|
|
|
2016-02-03 16:22:01 +01:00
|
|
|
10. It has happened that pcre2test was accidentally linked with another POSIX
|
|
|
|
regex library instead of libpcre2-posix. In this situation, a call to regcomp()
|
|
|
|
(in the other library) may succeed, returning zero, but of course putting its
|
|
|
|
own data into the regex_t block. In one example the re_pcre2_code field was
|
|
|
|
left as NULL, which made pcre2test think it had not got a compiled POSIX regex,
|
|
|
|
so it treated the next line as another pattern line, resulting in a confusing
|
2016-06-29 18:52:05 +02:00
|
|
|
error message. A check has been added to pcre2test to see if the data returned
|
|
|
|
from a successful call of regcomp() are valid for PCRE2's regcomp(). If they
|
|
|
|
are not, an error message is output and the pcre2test run is abandoned. The
|
|
|
|
message points out the possibility of a mis-linking. Hopefully this will avoid
|
2016-02-03 16:22:01 +01:00
|
|
|
some head-scratching the next time this happens.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
11. A pattern such as /(?<=((?C)0))/, which has a callout inside a lookbehind
|
|
|
|
assertion, caused pcre2test to output a very large number of spaces when the
|
2016-02-06 17:40:59 +01:00
|
|
|
callout was taken, making the program appearing to loop.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
12. A pattern that included (*ACCEPT) in the middle of a sufficiently deeply
|
|
|
|
nested set of parentheses of sufficient size caused an overflow of the
|
2016-02-10 19:24:02 +01:00
|
|
|
compiling workspace (which was diagnosed, but of course is not desirable).
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
13. Detect missing closing parentheses during the pre-pass for group
|
2016-02-13 16:30:29 +01:00
|
|
|
identification.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
14. Changed some integer variable types and put in a number of casts, following
|
|
|
|
a report of compiler warnings from Visual Studio 2013 and a few tests with
|
2016-02-16 11:23:06 +01:00
|
|
|
gcc's -Wconversion (which still throws up a lot).
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
15. Implemented pcre2_code_copy(), and added pushcopy and #popcopy to pcre2test
|
2016-12-11 17:47:39 +01:00
|
|
|
for testing it.
|
2016-02-26 19:26:17 +01:00
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
16. Change 66 for 10.21 introduced the use of snprintf() in PCRE2's version of
|
|
|
|
regerror(). When the error buffer is too small, my version of snprintf() puts a
|
|
|
|
binary zero in the final byte. Bug #1801 seems to show that other versions do
|
|
|
|
not do this, leading to bad output from pcre2test when it was checking for
|
|
|
|
buffer overflow. It no longer assumes a binary zero at the end of a too-small
|
2016-02-27 13:49:00 +01:00
|
|
|
regerror() buffer.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
17. Fixed typo ("&&" for "&") in pcre2_study(). Fortunately, this could not
|
2016-02-28 15:56:50 +01:00
|
|
|
actually affect anything, by sheer luck.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
18. Two minor fixes for MSVC compilation: (a) removal of apparently incorrect
|
|
|
|
"const" qualifiers in pcre2test and (b) defining snprintf as _snprintf for
|
|
|
|
older MSVC compilers. This has been done both in src/pcre2_internal.h for most
|
|
|
|
of the library, and also in src/pcre2posix.c, which no longer includes
|
2016-06-26 18:21:23 +02:00
|
|
|
pcre2_internal.h (see 24 below).
|
2016-02-29 19:31:30 +01:00
|
|
|
|
2016-06-24 11:07:15 +02:00
|
|
|
19. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC
|
|
|
|
static compilation. Subsequently applied Chris Wilson's second patch, putting
|
2016-06-29 18:52:05 +02:00
|
|
|
the first patch under a new option instead of being unconditional when
|
2016-06-24 11:07:15 +02:00
|
|
|
PCRE_STATIC is set.
|
2016-03-01 13:02:58 +01:00
|
|
|
|
2016-04-01 11:15:38 +02:00
|
|
|
20. Updated pcre2grep to set stdout as binary when run under Windows, so as not
|
2016-06-29 18:52:05 +02:00
|
|
|
to convert \r\n at the ends of reflected lines into \r\r\n. This required
|
|
|
|
ensuring that other output that is written to stdout (e.g. file names) uses the
|
2016-04-01 11:15:38 +02:00
|
|
|
appropriate line terminator: \r\n for Windows, \n otherwise.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
21. When a line is too long for pcre2grep's internal buffer, show the maximum
|
2016-04-01 11:15:38 +02:00
|
|
|
length in the error message.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
22. Added support for string callouts to pcre2grep (Zoltan's patch with PH
|
2016-04-01 17:52:08 +02:00
|
|
|
additions).
|
|
|
|
|
2016-04-22 16:10:51 +02:00
|
|
|
23. RunTest.bat was missing a "set type" line for test 22.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
24. The pcre2posix.c file was including pcre2_internal.h, and using some
|
|
|
|
"private" knowledge of the data structures. This is unnecessary; the code has
|
2016-05-14 18:35:20 +02:00
|
|
|
been re-factored and no longer includes pcre2_internal.h.
|
|
|
|
|
2016-05-19 20:09:07 +02:00
|
|
|
25. A racing condition is fixed in JIT reported by Mozilla.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
26. Minor code refactor to avoid "array subscript is below array bounds"
|
2016-05-20 12:47:42 +02:00
|
|
|
compiler warning.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
27. Minor code refactor to avoid "left shift of negative number" warning.
|
2016-05-20 12:47:42 +02:00
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
28. Add a bit more sanity checking to pcre2_serialize_decode() and document
|
2016-05-24 18:37:13 +02:00
|
|
|
that it expects trusted data.
|
|
|
|
|
2016-05-25 10:42:31 +02:00
|
|
|
29. Fix typo in pcre2_jit_test.c
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
30. Due to an oversight, pcre2grep was not making use of JIT when available.
|
2016-05-31 13:06:53 +02:00
|
|
|
This is now fixed.
|
|
|
|
|
2016-05-31 13:36:10 +02:00
|
|
|
31. The RunGrepTest script is updated to use the valgrind suppressions file
|
2016-06-29 18:52:05 +02:00
|
|
|
when testing with JIT under valgrind (compare 10.21/51 below). The suppressions
|
2016-05-31 13:36:10 +02:00
|
|
|
file is updated so that is now the same as for PCRE1: it suppresses the
|
|
|
|
Memcheck warnings Addr16 and Cond in unknown objects (that is, JIT-compiled
|
2016-06-29 18:52:05 +02:00
|
|
|
code). Also changed smc-check=all to smc-check=all-non-file as was done for
|
2016-05-31 13:36:10 +02:00
|
|
|
RunTest (see 4 above).
|
|
|
|
|
2016-06-05 18:05:34 +02:00
|
|
|
32. Implemented the PCRE2_NO_JIT option for pcre2_match().
|
|
|
|
|
2016-06-14 11:19:24 +02:00
|
|
|
33. Fix typo that gave a compiler error when JIT not supported.
|
|
|
|
|
2016-06-14 17:12:07 +02:00
|
|
|
34. Fix comment describing the returns from find_fixedlength().
|
|
|
|
|
2016-06-14 18:14:52 +02:00
|
|
|
35. Fix potential negative index in pcre2test.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
36. Calls to pcre2_get_error_message() with error numbers that are never
|
2016-06-17 13:30:27 +02:00
|
|
|
returned by PCRE2 functions were returning empty strings. Now the error code
|
2016-06-29 18:52:05 +02:00
|
|
|
PCRE2_ERROR_BADDATA is returned. A facility has been added to pcre2test to
|
|
|
|
show the texts for given error numbers (i.e. to call pcre2_get_error_message()
|
|
|
|
and display what it returns) and a few representative error codes are now
|
2016-06-17 13:30:27 +02:00
|
|
|
checked in RunTest.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
37. Added "&& !defined(__INTEL_COMPILER)" to the test for __GNUC__ in
|
|
|
|
pcre2_match.c, in anticipation that this is needed for the same reason it was
|
2016-06-17 13:45:16 +02:00
|
|
|
recently added to pcrecpp.cc in PCRE1.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
38. Using -o with -M in pcre2grep could cause unnecessary repeated output when
|
|
|
|
the match extended over a line boundary, as it tried to find more matches "on
|
2016-06-17 19:37:26 +02:00
|
|
|
the same line" - but it was already over the end.
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
39. Allow \C in lookbehinds and DFA matching in UTF-32 mode (by converting it
|
2016-06-20 20:14:51 +02:00
|
|
|
to the same code as '.' when PCRE2_DOTALL is set).
|
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
40. Fix two clang compiler warnings in pcre2test when only one code unit width
|
2016-06-22 12:41:05 +02:00
|
|
|
is supported.
|
|
|
|
|
2018-06-18 16:03:33 +02:00
|
|
|
41. Upgrade RunTest to automatically re-run test 2 with a large (64MiB) stack
|
|
|
|
if it fails when running the interpreter with a 16MiB stack (and if changing
|
|
|
|
the stack size via pcre2test is possible). This avoids having to manually set a
|
2016-06-22 21:23:33 +02:00
|
|
|
large stack size when testing with clang.
|
|
|
|
|
2016-07-01 10:56:59 +02:00
|
|
|
42. Fix register overwite in JIT when SSE2 acceleration is enabled.
|
|
|
|
|
2016-07-06 10:42:50 +02:00
|
|
|
43. Detect integer overflow in pcre2test pattern and data repetition counts.
|
|
|
|
|
2016-07-06 17:02:24 +02:00
|
|
|
44. In pcre2test, ignore "allcaptures" after DFA matching.
|
|
|
|
|
2016-07-15 12:02:19 +02:00
|
|
|
45. Fix unaligned accesses on x86. Patch by Marc Mutz.
|
|
|
|
|
2016-07-27 20:00:12 +02:00
|
|
|
46. Fix some more clang compiler warnings.
|
|
|
|
|
2016-01-29 16:01:17 +01:00
|
|
|
|
2016-01-12 15:44:34 +01:00
|
|
|
Version 10.21 12-January-2016
|
|
|
|
-----------------------------
|
2015-07-03 08:46:20 +02:00
|
|
|
|
|
|
|
1. Improve matching speed of patterns starting with + or * in JIT.
|
|
|
|
|
2015-07-06 18:05:41 +02:00
|
|
|
2. Use memchr() to find the first character in an unanchored match in 8-bit
|
|
|
|
mode in the interpreter. This gives a significant speed improvement.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
3. Removed a redundant copy of the opcode_possessify table in the
|
2015-07-06 18:07:54 +02:00
|
|
|
pcre2_auto_possessify.c source.
|
|
|
|
|
2015-07-08 10:30:23 +02:00
|
|
|
4. Fix typos in dftables.c for z/OS.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
5. Change 36 for 10.20 broke the handling of [[:>:]] and [[:<:]] in that
|
|
|
|
processing them could involve a buffer overflow if the following character was
|
2015-07-15 11:08:12 +02:00
|
|
|
an opening parenthesis.
|
|
|
|
|
2015-07-15 11:34:04 +02:00
|
|
|
6. Change 36 for 10.20 also introduced a bug in processing this pattern:
|
2015-11-03 20:14:31 +01:00
|
|
|
/((?x)(*:0))#(?'/. Specifically: if a setting of (?x) was followed by a (*MARK)
|
|
|
|
setting (which (*:0) is), then (?x) did not get unset at the end of its group
|
2015-07-15 11:34:04 +02:00
|
|
|
during the scan for named groups, and hence the external # was incorrectly
|
2015-07-16 18:15:52 +02:00
|
|
|
treated as a comment and the invalid (?' at the end of the pattern was not
|
|
|
|
diagnosed. This caused a buffer overflow during the real compile. This bug was
|
|
|
|
discovered by Karl Skomski with the LLVM fuzzer.
|
2015-07-15 11:34:04 +02:00
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
7. Moved the pcre2_find_bracket() function from src/pcre2_compile.c into its
|
|
|
|
own source module to avoid a circular dependency between src/pcre2_compile.c
|
2015-07-16 18:11:52 +02:00
|
|
|
and src/pcre2_study.c
|
|
|
|
|
2015-07-16 19:47:20 +02:00
|
|
|
8. A callout with a string argument containing an opening square bracket, for
|
|
|
|
example /(?C$[$)(?<]/, was incorrectly processed and could provoke a buffer
|
|
|
|
overflow. This bug was discovered by Karl Skomski with the LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
9. The handling of callouts during the pre-pass for named group identification
|
2015-07-16 19:47:20 +02:00
|
|
|
has been tightened up.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
10. The quantifier {1} can be ignored, whether greedy, non-greedy, or
|
2015-07-17 15:41:09 +02:00
|
|
|
possessive. This is a very minor optimization.
|
|
|
|
|
2015-07-17 17:11:45 +02:00
|
|
|
11. A possessively repeated conditional group that could match an empty string,
|
|
|
|
for example, /(?(R))*+/, was incorrectly compiled.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
12. The Unicode tables have been updated to Unicode 8.0.0 (thanks to Christian
|
2015-07-17 17:44:51 +02:00
|
|
|
Persch).
|
|
|
|
|
2015-07-17 18:25:21 +02:00
|
|
|
13. An empty comment (?#) in a pattern was incorrectly processed and could
|
|
|
|
provoke a buffer overflow. This bug was discovered by Karl Skomski with the
|
|
|
|
LLVM fuzzer.
|
|
|
|
|
2015-07-20 09:38:06 +02:00
|
|
|
14. Fix infinite recursion in the JIT compiler when certain patterns such as
|
|
|
|
/(?:|a|){100}x/ are analysed.
|
|
|
|
|
2015-07-20 12:17:23 +02:00
|
|
|
15. Some patterns with character classes involving [: and \\ were incorrectly
|
|
|
|
compiled and could cause reading from uninitialized memory or an incorrect
|
|
|
|
error diagnosis. Examples are: /[[:\\](?<[::]/ and /[[:\\](?'abc')[a:]. The
|
|
|
|
first of these bugs was discovered by Karl Skomski with the LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
16. Pathological patterns containing many nested occurrences of [: caused
|
|
|
|
pcre2_compile() to run for a very long time. This bug was found by the LLVM
|
2015-07-21 15:42:14 +02:00
|
|
|
fuzzer.
|
|
|
|
|
2015-07-21 16:03:08 +02:00
|
|
|
17. A missing closing parenthesis for a callout with a string argument was not
|
|
|
|
being diagnosed, possibly leading to a buffer overflow. This bug was found by
|
|
|
|
the LLVM fuzzer.
|
2015-07-20 12:17:23 +02:00
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
18. A conditional group with only one branch has an implicit empty alternative
|
2015-07-22 11:01:50 +02:00
|
|
|
branch and must therefore be treated as potentially matching an empty string.
|
|
|
|
|
2015-07-22 11:29:09 +02:00
|
|
|
19. If (?R was followed by - or + incorrect behaviour happened instead of a
|
|
|
|
diagnostic. This bug was discovered by Karl Skomski with the LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
20. Another bug that was introduced by change 36 for 10.20: conditional groups
|
|
|
|
whose condition was an assertion preceded by an explicit callout with a string
|
2015-07-22 16:34:31 +02:00
|
|
|
argument might be incorrectly processed, especially if the string contained \Q.
|
|
|
|
This bug was discovered by Karl Skomski with the LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
21. Compiling PCRE2 with the sanitize options of clang showed up a number of
|
|
|
|
very pedantic coding infelicities and a buffer overflow while checking a UTF-8
|
2015-07-24 15:30:50 +02:00
|
|
|
string if the final multi-byte UTF-8 character was truncated.
|
|
|
|
|
2015-07-24 20:18:05 +02:00
|
|
|
22. For Perl compatibility in EBCDIC environments, ranges such as a-z in a
|
2015-11-03 20:14:31 +01:00
|
|
|
class, where both values are literal letters in the same case, omit the
|
2015-07-24 20:18:05 +02:00
|
|
|
non-letter EBCDIC code points within the range.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
23. Finding the minimum matching length of complex patterns with back
|
|
|
|
references and/or recursions can take a long time. There is now a cut-off that
|
|
|
|
gives up trying to find a minimum length when things get too complex.
|
2015-08-01 11:11:28 +02:00
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
24. An optimization has been added that speeds up finding the minimum matching
|
2015-08-01 11:11:28 +02:00
|
|
|
length for patterns containing repeated capturing groups or recursions.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
25. If a pattern contained a back reference to a group whose number was
|
|
|
|
duplicated as a result of appearing in a (?|...) group, the computation of the
|
2015-08-03 15:18:49 +02:00
|
|
|
minimum matching length gave a wrong result, which could cause incorrect "no
|
2015-11-03 20:14:31 +01:00
|
|
|
match" errors. For such patterns, a minimum matching length cannot at present
|
2015-08-03 15:18:49 +02:00
|
|
|
be computed.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
26. Added a check for integer overflow in conditions (?(<digits>) and
|
2015-08-04 11:13:11 +02:00
|
|
|
(?(R<digits>). This omission was discovered by Karl Skomski with the LLVM
|
|
|
|
fuzzer.
|
|
|
|
|
2015-08-05 11:04:01 +02:00
|
|
|
27. Fixed an issue when \p{Any} inside an xclass did not read the current
|
|
|
|
character.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
28. If pcre2grep was given the -q option with -c or -l, or when handling a
|
2015-08-05 19:35:36 +02:00
|
|
|
binary file, it incorrectly wrote output to stdout.
|
|
|
|
|
2015-08-08 07:45:17 +02:00
|
|
|
29. The JIT compiler did not restore the control verb head in case of *THEN
|
|
|
|
control verbs. This issue was found by Karl Skomski with a custom LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
30. The way recursive references such as (?3) are compiled has been re-written
|
|
|
|
because the old way was the cause of many issues. Now, conversion of the group
|
|
|
|
number into a pattern offset does not happen until the pattern has been
|
2015-08-09 18:29:35 +02:00
|
|
|
completely compiled. This does mean that detection of all infinitely looping
|
2015-11-03 20:14:31 +01:00
|
|
|
recursions is postponed till match time. In the past, some easy ones were
|
|
|
|
detected at compile time. This re-writing was done in response to yet another
|
2015-08-09 18:29:35 +02:00
|
|
|
bug found by the LLVM fuzzer.
|
|
|
|
|
2015-08-09 19:46:35 +02:00
|
|
|
31. A test for a back reference to a non-existent group was missing for items
|
2015-11-03 20:14:31 +01:00
|
|
|
such as \987. This caused incorrect code to be compiled. This issue was found
|
2015-08-09 19:46:35 +02:00
|
|
|
by Karl Skomski with a custom LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
32. Error messages for syntax errors following \g and \k were giving inaccurate
|
2015-08-09 19:46:35 +02:00
|
|
|
offsets in the pattern.
|
|
|
|
|
2015-08-10 14:28:27 +02:00
|
|
|
33. Improve the performance of starting single character repetitions in JIT.
|
|
|
|
|
2015-08-10 18:34:17 +02:00
|
|
|
34. (*LIMIT_MATCH=) now gives an error instead of setting the value to 0.
|
|
|
|
|
|
|
|
35. Error messages for syntax errors in *LIMIT_MATCH and *LIMIT_RECURSION now
|
|
|
|
give the right offset instead of zero.
|
|
|
|
|
2015-08-11 07:30:10 +02:00
|
|
|
36. The JIT compiler should not check repeats after a {0,1} repeat byte code.
|
|
|
|
This issue was found by Karl Skomski with a custom LLVM fuzzer.
|
|
|
|
|
2015-08-11 15:20:37 +02:00
|
|
|
37. The JIT compiler should restore the control chain for empty possessive
|
|
|
|
repeats. This issue was found by Karl Skomski with a custom LLVM fuzzer.
|
|
|
|
|
2015-08-13 13:35:38 +02:00
|
|
|
38. A bug which was introduced by the single character repetition optimization
|
|
|
|
was fixed.
|
|
|
|
|
2015-08-14 11:36:04 +02:00
|
|
|
39. Match limit check added to recursion. This issue was found by Karl Skomski
|
|
|
|
with a custom LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
40. Arrange for the UTF check in pcre2_match() and pcre2_dfa_match() to look
|
|
|
|
only at the part of the subject that is relevant when the starting offset is
|
2015-08-18 12:34:05 +02:00
|
|
|
non-zero.
|
|
|
|
|
2015-08-23 03:54:04 +02:00
|
|
|
41. Improve first character match in JIT with SSE2 on x86.
|
|
|
|
|
2015-08-24 11:25:04 +02:00
|
|
|
42. Fix two assertion fails in JIT. These issues were found by Karl Skomski
|
|
|
|
with a custom LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
43. Correct the setting of CMAKE_C_FLAGS in CMakeLists.txt (patch from Roy Ivy
|
2015-08-24 18:04:32 +02:00
|
|
|
III).
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
44. Fix bug in RunTest.bat for new test 14, and adjust the script for the added
|
2015-08-24 18:31:30 +02:00
|
|
|
test (there are now 20 in total).
|
2015-08-24 18:09:39 +02:00
|
|
|
|
2015-08-26 15:35:58 +02:00
|
|
|
45. Fixed a corner case of range optimization in JIT.
|
|
|
|
|
2015-08-29 19:13:09 +02:00
|
|
|
46. Add the ${*MARK} facility to pcre2_substitute().
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
47. Modifier lists in pcre2test were splitting at spaces without the required
|
2015-08-30 16:11:15 +02:00
|
|
|
commas.
|
|
|
|
|
2015-08-30 19:47:36 +02:00
|
|
|
48. Implemented PCRE2_ALT_VERBNAMES.
|
|
|
|
|
2015-09-02 10:35:50 +02:00
|
|
|
49. Fixed two issues in JIT. These were found by Karl Skomski with a custom
|
|
|
|
LLVM fuzzer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
50. The pcre2test program has been extended by adding the #newline_default
|
|
|
|
command. This has made it possible to run the standard tests when PCRE2 is
|
|
|
|
compiled with either CR or CRLF as the default newline convention. As part of
|
|
|
|
this work, the new command was added to several test files and the testing
|
|
|
|
scripts were modified. The pcre2grep tests can now also be run when there is no
|
2015-09-08 19:01:17 +02:00
|
|
|
LF in the default newline convention.
|
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
51. The RunTest script has been modified so that, when JIT is used and valgrind
|
|
|
|
is specified, a valgrind suppressions file is set up to ignore "Invalid read of
|
|
|
|
size 16" errors because these are false positives when the hardware supports
|
|
|
|
the SSE2 instruction set.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
52. It is now possible to have comment lines amid the subject strings in
|
2015-09-14 17:10:19 +02:00
|
|
|
pcre2test (and perltest.sh) input.
|
|
|
|
|
2015-09-22 13:24:28 +02:00
|
|
|
53. Implemented PCRE2_USE_OFFSET_LIMIT and pcre2_set_offset_limit().
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
54. Add the null_context modifier to pcre2test so that calling pcre2_compile()
|
2015-09-23 13:49:03 +02:00
|
|
|
and the matching functions with NULL contexts can be tested.
|
|
|
|
|
2015-10-07 19:32:48 +02:00
|
|
|
55. Implemented PCRE2_SUBSTITUTE_EXTENDED.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
56. In a character class such as [\W\p{Any}] where both a negative-type escape
|
|
|
|
("not a word character") and a property escape were present, the property
|
2015-10-09 18:06:53 +02:00
|
|
|
escape was being ignored.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
57. Fixed integer overflow for patterns whose minimum matching length is very,
|
2015-10-09 18:54:29 +02:00
|
|
|
very large.
|
|
|
|
|
2015-10-17 15:50:56 +02:00
|
|
|
58. Implemented --never-backslash-C.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
59. Change 55 above introduced a bug by which certain patterns provoked the
|
2015-10-17 20:29:01 +02:00
|
|
|
erroneous error "\ at end of pattern".
|
|
|
|
|
2015-10-21 17:59:45 +02:00
|
|
|
60. The special sequences [[:<:]] and [[:>:]] gave rise to incorrect compiling
|
|
|
|
errors or other strange effects if compiled in UCP mode. Found with libFuzzer
|
|
|
|
and AddressSanitizer.
|
2015-10-21 13:29:07 +02:00
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
61. Whitespace at the end of a pcre2test pattern line caused a spurious error
|
2015-10-22 17:49:54 +02:00
|
|
|
message if there were only single-character modifiers. It should be ignored.
|
|
|
|
|
2015-10-25 18:35:34 +01:00
|
|
|
62. The use of PCRE2_NO_AUTO_CAPTURE could cause incorrect compilation results
|
|
|
|
or segmentation errors for some patterns. Found with libFuzzer and
|
|
|
|
AddressSanitizer.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
63. Very long names in (*MARK) or (*THEN) etc. items could provoke a buffer
|
2015-10-28 10:25:31 +01:00
|
|
|
overflow.
|
|
|
|
|
2015-10-28 10:59:53 +01:00
|
|
|
64. Improve error message for overly-complicated patterns.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
65. Implemented an optional replication feature for patterns in pcre2test, to
|
|
|
|
make it easier to test long repetitive patterns. The tests for 63 above are
|
2015-10-30 16:20:07 +01:00
|
|
|
converted to use the new feature.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
66. In the POSIX wrapper, if regerror() was given too small a buffer, it could
|
2015-10-30 18:17:40 +01:00
|
|
|
misbehave.
|
|
|
|
|
2015-10-30 18:30:03 +01:00
|
|
|
67. In pcre2_substitute() in UTF mode, the UTF validity check on the
|
|
|
|
replacement string was happening before the length setting when the replacement
|
|
|
|
string was zero-terminated.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
68. In pcre2_substitute() in UTF mode, PCRE2_NO_UTF_CHECK can be set for the
|
2015-10-30 18:41:56 +01:00
|
|
|
second and subsequent calls to pcre2_match().
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
69. There was no check for integer overflow for a replacement group number in
|
|
|
|
pcre2_substitute(). An added check for a number greater than the largest group
|
2015-10-30 19:25:19 +01:00
|
|
|
number in the pattern means this is not now needed.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
70. The PCRE2-specific VERSION condition didn't work correctly if only one
|
|
|
|
digit was given after the decimal point, or if more than two digits were given.
|
|
|
|
It now works with one or two digits, and gives a compile time error if more are
|
2015-11-01 17:28:13 +01:00
|
|
|
given.
|
|
|
|
|
2015-11-03 20:14:31 +01:00
|
|
|
71. In pcre2_substitute() there was the possibility of reading one code unit
|
2015-11-01 17:36:20 +01:00
|
|
|
beyond the end of the replacement string.
|
|
|
|
|
2015-11-01 17:54:17 +01:00
|
|
|
72. The code for checking a subject's UTF-32 validity for a pattern with a
|
2015-11-03 20:14:31 +01:00
|
|
|
lookbehind involved an out-of-bounds pointer, which could potentially cause
|
2015-11-01 17:54:17 +01:00
|
|
|
trouble in some environments.
|
|
|
|
|
2015-11-01 18:31:48 +01:00
|
|
|
73. The maximum lookbehind length was incorrectly calculated for patterns such
|
|
|
|
as /(?<=(a)(?-1))x/ which have a recursion within a backreference.
|
|
|
|
|
2015-11-03 11:39:27 +01:00
|
|
|
74. Give an error if a lookbehind assertion is longer than 65535 code units.
|
|
|
|
|
2015-11-03 18:38:00 +01:00
|
|
|
75. Give an error in pcre2_substitute() if a match ends before it starts (as a
|
|
|
|
result of the use of \K).
|
|
|
|
|
2015-11-03 21:04:23 +01:00
|
|
|
76. Check the length of subpattern names and the names in (*MARK:xx) etc.
|
|
|
|
dynamically to avoid the possibility of integer overflow.
|
2015-11-03 20:14:31 +01:00
|
|
|
|
2015-11-05 18:33:39 +01:00
|
|
|
77. Implement pcre2_set_max_pattern_length() so that programs can restrict the
|
|
|
|
size of patterns that they are prepared to handle.
|
|
|
|
|
2015-11-05 19:03:16 +01:00
|
|
|
78. (*NO_AUTO_POSSESS) was not working.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
79. Adding group information caching improves the speed of compiling when
|
|
|
|
checking whether a group has a fixed length and/or could match an empty string,
|
|
|
|
especially when recursion or subroutine calls are involved. However, this
|
|
|
|
cannot be used when (?| is present in the pattern because the same number may
|
|
|
|
be used for groups of different sizes. To catch runaway patterns in this
|
|
|
|
situation, counts have been introduced to the functions that scan for empty
|
2015-11-10 15:33:28 +01:00
|
|
|
branches or compute fixed lengths.
|
2015-11-08 15:20:09 +01:00
|
|
|
|
2015-11-09 18:39:43 +01:00
|
|
|
80. Allow for the possibility of the size of the nest_save structure not being
|
|
|
|
a factor of the size of the compiling workspace (it currently is).
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
81. Check for integer overflow in minimum length calculation and cap it at
|
2015-11-09 19:45:15 +01:00
|
|
|
65535.
|
|
|
|
|
2015-11-11 10:42:26 +01:00
|
|
|
82. Small optimizations in code for finding the minimum matching length.
|
|
|
|
|
2015-11-11 18:43:37 +01:00
|
|
|
83. Lock out configuring for EBCDIC with non-8-bit libraries.
|
|
|
|
|
2015-11-11 18:52:11 +01:00
|
|
|
84. Test for error code <= 0 in regerror().
|
|
|
|
|
2015-11-11 19:35:14 +01:00
|
|
|
85. Check for too many replacements (more than INT_MAX) in pcre2_substitute().
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
86. Avoid the possibility of computing with an out-of-bounds pointer (though
|
2015-11-12 18:24:58 +01:00
|
|
|
not dereferencing it) while handling lookbehind assertions.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
87. Failure to get memory for the match data in regcomp() is now given as a
|
2015-11-12 19:35:49 +01:00
|
|
|
regcomp() error instead of waiting for regexec() to pick it up.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
88. In pcre2_substitute(), ensure that CRLF is not split when it is a valid
|
2015-11-13 17:52:26 +01:00
|
|
|
newline sequence.
|
|
|
|
|
2015-11-13 18:26:42 +01:00
|
|
|
89. Paranoid check in regcomp() for bad error code from pcre2_compile().
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
90. Run test 8 (internal offsets and code sizes) for link sizes 3 and 4 as well
|
2015-11-14 14:22:34 +01:00
|
|
|
as for link size 2.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
91. Document that JIT has a limit on pattern size, and give more information
|
2015-11-14 17:48:32 +01:00
|
|
|
about JIT compile failures in pcre2test.
|
|
|
|
|
2015-11-14 18:28:19 +01:00
|
|
|
92. Implement PCRE2_INFO_HASBACKSLASHC.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
93. Re-arrange valgrind support code in pcre2test to avoid spurious reports
|
2015-11-15 19:55:20 +01:00
|
|
|
with JIT (possibly caused by SSE2?).
|
|
|
|
|
2015-11-16 09:30:48 +01:00
|
|
|
94. Support offset_limit in JIT.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
95. A sequence such as [[:punct:]b] that is, a POSIX character class followed
|
|
|
|
by a single ASCII character in a class item, was incorrectly compiled in UCP
|
2015-11-17 18:13:43 +01:00
|
|
|
mode. The POSIX class got lost, but only if the single character followed it.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
96. [:punct:] in UCP mode was matching some characters in the range 128-255
|
2015-11-17 18:59:35 +01:00
|
|
|
that should not have been matched.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
97. If [:^ascii:] or [:^xdigit:] are present in a non-negated class, all
|
|
|
|
characters with code points greater than 255 are in the class. When a Unicode
|
|
|
|
property was also in the class (if PCRE2_UCP is set, escapes such as \w are
|
|
|
|
turned into Unicode properties), wide characters were not correctly handled,
|
2015-11-20 17:55:36 +01:00
|
|
|
and could fail to match.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
98. In pcre2test, make the "startoffset" modifier a synonym of "offset",
|
2015-11-21 17:10:24 +01:00
|
|
|
because it sets the "startoffset" parameter for pcre2_match().
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
99. If PCRE2_AUTO_CALLOUT was set on a pattern that had a (?# comment between
|
|
|
|
an item and its qualifier (for example, A(?#comment)?B) pcre2_compile()
|
2015-11-27 16:58:44 +01:00
|
|
|
misbehaved. This bug was found by the LLVM fuzzer.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
100. The error for an invalid UTF pattern string always gave the code unit
|
2015-11-27 16:58:44 +01:00
|
|
|
offset as zero instead of where the invalidity was found.
|
2015-11-25 19:46:35 +01:00
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
101. Further to 97 above, negated classes such as [^[:^ascii:]\d] were also not
|
2015-11-27 18:03:58 +01:00
|
|
|
working correctly in UCP mode.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
102. Similar to 99 above, if an isolated \E was present between an item and its
|
2015-11-27 18:34:36 +01:00
|
|
|
qualifier when PCRE2_AUTO_CALLOUT was set, pcre2_compile() misbehaved. This bug
|
|
|
|
was found by the LLVM fuzzer.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
103. The POSIX wrapper function regexec() crashed if the option REG_STARTEND
|
2015-11-29 18:38:12 +01:00
|
|
|
was set when the pmatch argument was NULL. It now returns REG_INVARG.
|
|
|
|
|
2015-11-29 18:45:27 +01:00
|
|
|
104. Allow for up to 32-bit numbers in the ordin() function in pcre2grep.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
105. An empty \Q\E sequence between an item and its qualifier caused
|
2015-11-30 18:31:16 +01:00
|
|
|
pcre2_compile() to misbehave when auto callouts were enabled. This bug
|
|
|
|
was found by the LLVM fuzzer.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
106. If both PCRE2_ALT_VERBNAMES and PCRE2_EXTENDED were set, and a (*MARK) or
|
|
|
|
other verb "name" ended with whitespace immediately before the closing
|
|
|
|
parenthesis, pcre2_compile() misbehaved. Example: /(*:abc )/, but only when
|
2015-12-01 18:41:24 +01:00
|
|
|
both those options were set.
|
|
|
|
|
2015-12-02 18:39:26 +01:00
|
|
|
107. In a number of places pcre2_compile() was not handling NULL characters
|
|
|
|
correctly, and pcre2test with the "bincode" modifier was not always correctly
|
|
|
|
displaying fields containing NULLS:
|
|
|
|
|
|
|
|
(a) Within /x extended #-comments
|
2015-12-17 19:44:06 +01:00
|
|
|
(b) Within the "name" part of (*MARK) and other *verbs
|
|
|
|
(c) Within the text argument of a callout
|
|
|
|
|
|
|
|
108. If a pattern that was compiled with PCRE2_EXTENDED started with white
|
|
|
|
space or a #-type comment that was followed by (?-x), which turns off
|
2015-12-03 17:58:31 +01:00
|
|
|
PCRE2_EXTENDED, and there was no subsequent (?x) to turn it on again,
|
|
|
|
pcre2_compile() assumed that (?-x) applied to the whole pattern and
|
2015-12-17 19:44:06 +01:00
|
|
|
consequently mis-compiled it. This bug was found by the LLVM fuzzer. The fix
|
2016-02-27 13:49:00 +01:00
|
|
|
for this bug means that a setting of any of the (?imsxJU) options at the start
|
2015-12-17 19:44:06 +01:00
|
|
|
of a pattern is no longer transferred to the options that are returned by
|
|
|
|
PCRE2_INFO_ALLOPTIONS. In fact, this was an anachronism that should have
|
2015-12-03 18:19:13 +01:00
|
|
|
changed when the effects of those options were all moved to compile time.
|
2015-12-02 18:39:26 +01:00
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
109. An escaped closing parenthesis in the "name" part of a (*verb) when
|
2015-12-03 19:36:36 +01:00
|
|
|
PCRE2_ALT_VERBNAMES was set caused pcre2_compile() to malfunction. This bug
|
|
|
|
was found by the LLVM fuzzer.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
110. Implemented PCRE2_SUBSTITUTE_UNSET_EMPTY, and updated pcre2test to make it
|
2015-12-04 19:39:08 +01:00
|
|
|
possible to test it.
|
|
|
|
|
2015-12-17 19:44:06 +01:00
|
|
|
111. "Harden" pcre2test against ridiculously large values in modifiers and
|
2015-12-05 19:17:41 +01:00
|
|
|
command line arguments.
|
|
|
|
|
2015-12-12 19:45:40 +01:00
|
|
|
112. Implemented PCRE2_SUBSTITUTE_UNKNOWN_UNSET and PCRE2_SUBSTITUTE_OVERFLOW_
|
|
|
|
LENGTH.
|
|
|
|
|
2015-12-16 19:44:24 +01:00
|
|
|
113. Fix printing of *MARK names that contain binary zeroes in pcre2test.
|
|
|
|
|
2015-07-03 08:46:20 +02:00
|
|
|
|
2015-06-30 12:28:59 +02:00
|
|
|
Version 10.20 30-June-2015
|
2015-06-18 18:39:25 +02:00
|
|
|
--------------------------
|
2015-03-11 18:44:16 +01:00
|
|
|
|
|
|
|
1. Callouts with string arguments have been added.
|
|
|
|
|
2015-03-12 12:49:29 +01:00
|
|
|
2. Assertion code generator in JIT has been optimized.
|
|
|
|
|
2015-03-20 13:37:28 +01: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 16:52:08 +01:00
|
|
|
error. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
|
|
|
4. Implemented pcre2_callout_enumerate().
|
2015-03-20 13:37:28 +01:00
|
|
|
|
2015-03-24 11:21:34 +01: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 09:43:52 +01:00
|
|
|
|
2015-03-25 18:01:04 +01:00
|
|
|
8. For some types of pattern, for example /Z*(|d*){216}/, the auto-
|
2015-05-15 19:09:01 +02:00
|
|
|
possessification code could take exponential time to complete. A recursion
|
|
|
|
depth limit of 1000 has been imposed to limit the resources used by this
|
2015-03-25 18:01:04 +01:00
|
|
|
optimization. This infelicity was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
9. A pattern such as /(*UTF)[\S\V\H]/, which contains a negated special class
|
|
|
|
such as \S in non-UCP mode, explicit wide characters (> 255) can be ignored
|
2015-03-25 20:26:27 +01:00
|
|
|
because \S ensures they are all in the class. The code for doing this was
|
|
|
|
interacting badly with the code for computing the amount of space needed to
|
|
|
|
compile the pattern, leading to a buffer overflow. This bug was discovered by
|
|
|
|
the LLVM fuzzer.
|
|
|
|
|
2015-03-27 18:45:02 +01:00
|
|
|
10. A pattern such as /((?2)+)((?1))/ which has mutual recursion nested inside
|
|
|
|
other kinds of group caused stack overflow at compile time. This bug was
|
|
|
|
discovered by the LLVM fuzzer.
|
|
|
|
|
2015-03-29 13:15:32 +02:00
|
|
|
11. A pattern such as /(?1)(?#?'){8}(a)/ which had a parenthesized comment
|
|
|
|
between a subroutine call and its quantifier was incorrectly compiled, leading
|
|
|
|
to buffer overflow or other errors. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
12. The illegal pattern /(?(?<E>.*!.*)?)/ was not being diagnosed as missing an
|
|
|
|
assertion after (?(. The code was failing to check the character after (?(?<
|
2015-03-29 17:40:45 +02:00
|
|
|
for the ! or = that would indicate a lookbehind assertion. This bug was
|
|
|
|
discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
13. A pattern such as /X((?2)()*+){2}+/ which has a possessive quantifier with
|
|
|
|
a fixed maximum following a group that contains a subroutine reference was
|
|
|
|
incorrectly compiled and could trigger buffer overflow. This bug was discovered
|
2015-03-29 19:34:04 +02:00
|
|
|
by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
14. Negative relative recursive references such as (?-7) to non-existent
|
|
|
|
subpatterns were not being diagnosed and could lead to unpredictable behaviour.
|
2015-03-31 17:01:25 +02:00
|
|
|
This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
15. The bug fixed in 14 was due to an integer variable that was unsigned when
|
2015-03-31 18:10:01 +02:00
|
|
|
it should have been signed. Some other "int" variables, having been checked,
|
|
|
|
have either been changed to uint32_t or commented as "must be signed".
|
|
|
|
|
2015-04-01 17:37:54 +02:00
|
|
|
16. A mutual recursion within a lookbehind assertion such as (?<=((?2))((?1)))
|
|
|
|
caused a stack overflow instead of the diagnosis of a non-fixed length
|
|
|
|
lookbehind assertion. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-04-03 13:14:19 +02:00
|
|
|
17. The use of \K in a positive lookbehind assertion in a non-anchored pattern
|
|
|
|
(e.g. /(?<=\Ka)/) could make pcre2grep loop.
|
|
|
|
|
2015-04-06 14:16:36 +02:00
|
|
|
18. There was a similar problem to 17 in pcre2test for global matches, though
|
|
|
|
the code there did catch the loop.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
19. If a greedy quantified \X was preceded by \C in UTF mode (e.g. \C\X*),
|
2015-04-08 18:53:22 +02:00
|
|
|
and a subsequent item in the pattern caused a non-match, backtracking over the
|
|
|
|
repeated \X did not stop, but carried on past the start of the subject, causing
|
|
|
|
reference to random memory and/or a segfault. There were also some other cases
|
|
|
|
where backtracking after \C could crash. This set of bugs was discovered by the
|
2015-04-08 18:33:58 +02:00
|
|
|
LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
20. The function for finding the minimum length of a matching string could take
|
|
|
|
a very long time if mutual recursion was present many times in a pattern, for
|
|
|
|
example, /((?2){73}(?2))((?1))/. A better mutual recursion detection method has
|
2015-04-13 11:13:39 +02:00
|
|
|
been implemented. This infelicity was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-04-13 19:29:05 +02:00
|
|
|
21. Implemented PCRE2_NEVER_BACKSLASH_C.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
22. The feature for string replication in pcre2test could read from freed
|
2015-04-21 10:34:10 +02:00
|
|
|
memory if the replication required a buffer to be extended, and it was not
|
2015-05-15 19:09:01 +02:00
|
|
|
working properly in 16-bit and 32-bit modes. This issue was discovered by a
|
2015-04-21 10:34:10 +02:00
|
|
|
fuzzer: see http://lcamtuf.coredump.cx/afl/.
|
|
|
|
|
2015-04-22 19:39:25 +02:00
|
|
|
23. Added the PCRE2_ALT_CIRCUMFLEX option.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
24. Adjust the treatment of \8 and \9 to be the same as the current Perl
|
2015-04-23 19:28:39 +02:00
|
|
|
behaviour.
|
|
|
|
|
2015-04-23 19:38:02 +02:00
|
|
|
25. Static linking against the PCRE2 library using the pkg-config module was
|
|
|
|
failing on missing pthread symbols.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
26. If a group that contained a recursive back reference also contained a
|
|
|
|
forward reference subroutine call followed by a non-forward-reference
|
|
|
|
subroutine call, for example /.((?2)(?R)\1)()/, pcre2_compile() failed to
|
|
|
|
compile correct code, leading to undefined behaviour or an internally detected
|
2015-05-03 18:46:56 +02:00
|
|
|
error. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
27. Quantification of certain items (e.g. atomic back references) could cause
|
|
|
|
incorrect code to be compiled when recursive forward references were involved.
|
2015-05-06 18:51:25 +02:00
|
|
|
For example, in this pattern: /(?1)()((((((\1++))\x85)+)|))/. This bug was
|
|
|
|
discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-08 18:32:28 +02:00
|
|
|
28. A repeated conditional group whose condition was a reference by name caused
|
|
|
|
a buffer overflow if there was more than one group with the given name. This
|
|
|
|
bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-15 19:09:01 +02:00
|
|
|
29. A recursive back reference by name within a group that had the same name as
|
|
|
|
another group caused a buffer overflow. For example: /(?J)(?'d'(?'d'\g{d}))/.
|
|
|
|
This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-16 13:01:48 +02:00
|
|
|
30. A forward reference by name to a group whose number is the same as the
|
|
|
|
current group, for example in this pattern: /(?|(\k'Pm')|(?'Pm'))/, caused a
|
|
|
|
buffer overflow at compile time. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-06-18 18:39:25 +02:00
|
|
|
31. Fix -fsanitize=undefined warnings for left shifts of 1 by 31 (it treats 1
|
2015-05-16 18:02:46 +02:00
|
|
|
as an int; fixed by writing it as 1u).
|
|
|
|
|
2015-06-18 18:39:25 +02:00
|
|
|
32. Fix pcre2grep compile when -std=c99 is used with gcc, though it still gives
|
2015-05-16 18:52:45 +02:00
|
|
|
a warning for "fileno" unless -std=gnu99 us used.
|
|
|
|
|
2015-06-18 18:39:25 +02:00
|
|
|
33. A lookbehind assertion within a set of mutually recursive subpatterns could
|
2015-05-18 19:31:29 +02:00
|
|
|
provoke a buffer overflow. This bug was discovered by the LLVM fuzzer.
|
|
|
|
|
2015-05-19 18:48:57 +02:00
|
|
|
34. Give an error for an empty subpattern name such as (?'').
|
|
|
|
|
2015-06-18 18:39:25 +02:00
|
|
|
35. Make pcre2test give an error if a pattern that follows #forbud_utf contains
|
2015-05-20 19:44:17 +02:00
|
|
|
\P, \p, or \X.
|
|
|
|
|
2015-06-18 18:39:25 +02:00
|
|
|
36. The way named subpatterns are handled has been refactored. There is now a
|
2015-06-03 18:27:47 +02:00
|
|
|
pre-pass over the regex which does nothing other than identify named
|
|
|
|
subpatterns and count the total captures. This means that information about
|
2015-06-18 18:39:25 +02:00
|
|
|
named patterns is known before the rest of the compile. In particular, it means
|
|
|
|
that forward references can be checked as they are encountered. Previously, the
|
|
|
|
code for handling forward references was contorted and led to several errors in
|
|
|
|
computing the memory requirements for some patterns, leading to buffer
|
2015-06-03 18:27:47 +02:00
|
|
|
overflows.
|
|
|
|
|
2015-06-08 19:51:54 +02:00
|
|
|
37. There was no check for integer overflow in subroutine calls such as (?123).
|
|
|
|
|
2015-06-09 18:33:44 +02:00
|
|
|
38. The table entry for \l in EBCDIC environments was incorrect, leading to its
|
|
|
|
being treated as a literal 'l' instead of causing an error.
|
|
|
|
|
2015-06-09 19:41:45 +02:00
|
|
|
39. If a non-capturing group containing a conditional group that could match
|
2015-06-18 18:39:25 +02:00
|
|
|
an empty string was repeated, it was not identified as matching an empty string
|
2015-06-09 19:41:45 +02:00
|
|
|
itself. For example: /^(?:(?(1)x|)+)+$()/.
|
|
|
|
|
2015-06-12 18:25:23 +02:00
|
|
|
40. In an EBCDIC environment, pcretest was mishandling the escape sequences
|
2015-06-18 18:39:25 +02:00
|
|
|
\a and \e in test subject lines.
|
2015-06-12 18:25:23 +02:00
|
|
|
|
|
|
|
41. In an EBCDIC environment, \a in a pattern was converted to the ASCII
|
|
|
|
instead of the EBCDIC value.
|
|
|
|
|
2015-06-13 18:10:14 +02:00
|
|
|
42. The handling of \c in an EBCDIC environment has been revised so that it is
|
|
|
|
now compatible with the specification in Perl's perlebcdic page.
|
|
|
|
|
2015-06-16 13:37:19 +02:00
|
|
|
43. Single character repetition in JIT has been improved. 20-30% speedup
|
|
|
|
was achieved on certain patterns.
|
|
|
|
|
2015-06-19 18:41:22 +02:00
|
|
|
44. The EBCDIC character 0x41 is a non-breaking space, equivalent to 0xa0 in
|
|
|
|
ASCII/Unicode. This has now been added to the list of characters that are
|
|
|
|
recognized as white space in EBCDIC.
|
2015-07-02 15:18:14 +02:00
|
|
|
|
2015-06-19 18:41:22 +02:00
|
|
|
45. When PCRE2 was compiled without Unicode support, the use of \p and \P gave
|
|
|
|
an error (correctly) when used outside a class, but did not give an error
|
|
|
|
within a class.
|
|
|
|
|
2015-07-02 15:18:14 +02:00
|
|
|
46. \h within a class was incorrectly compiled in EBCDIC environments.
|
2015-06-22 15:40:23 +02:00
|
|
|
|
2015-06-28 15:31:24 +02:00
|
|
|
47. JIT should return with error when the compiled pattern requires
|
|
|
|
more stack space than the maximum.
|
|
|
|
|
2015-06-30 12:28:59 +02:00
|
|
|
48. Fixed a memory leak in pcre2grep when a locale is set.
|
|
|
|
|
2015-03-11 18:44:16 +01:00
|
|
|
|
2015-03-06 16:08:29 +01:00
|
|
|
Version 10.10 06-March-2015
|
|
|
|
---------------------------
|
2015-01-13 17:01:24 +01:00
|
|
|
|
2015-01-23 17:51:47 +01: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 17:01:24 +01: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 17:51:47 +01: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 15:57:27 +01:00
|
|
|
5. The (*NO_JIT) feature is implemented.
|
|
|
|
|
2015-01-27 18:21:32 +01:00
|
|
|
6. If a bug that caused pcre2_compile() to use more memory than allocated was
|
2015-02-20 12:20:40 +01:00
|
|
|
triggered when using valgrind, the code in (3) above passed a stupidly large
|
2015-01-27 18:21:32 +01:00
|
|
|
value to valgrind. This caused a crash instead of an "internal error" return.
|
|
|
|
|
2015-02-20 12:20:40 +01: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 18:21:32 +01:00
|
|
|
to be incorrectly calculated, leading to overwriting.
|
|
|
|
|
2015-02-20 12:20:40 +01: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 12:28:53 +01:00
|
|
|
The infinite loop is now broken (with the minimum length unset, that is, zero).
|
|
|
|
|
2015-02-20 12:20:40 +01: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 18:31:11 +01: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 12:20:40 +01:00
|
|
|
10. The error message for an invalid quantifier has been changed from "nothing
|
2015-01-28 18:31:11 +01:00
|
|
|
to repeat" to "quantifier does not follow a repeatable item".
|
|
|
|
|
2015-02-06 17:47:15 +01: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 12:20:40 +01:00
|
|
|
12. A UTF pattern containing a "not" match of a non-ASCII character and a
|
2015-02-06 18:51:55 +01:00
|
|
|
subroutine reference could loop at compile time. Example: /[^\xff]((?1))/.
|
|
|
|
|
2015-02-20 12:20:40 +01: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 18:45:55 +01:00
|
|
|
locales that can be used.
|
|
|
|
|
2015-02-10 13:48:45 +01: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 11:06:09 +01:00
|
|
|
15. A possessive capturing group such as (a)*+ with a minimum repeat of zero
|
2015-02-20 12:20:40 +01:00
|
|
|
failed to allow the zero-repeat case if pcre2_match() was called with an
|
2015-02-11 11:06:09 +01:00
|
|
|
ovector too small to capture the group.
|
|
|
|
|
2015-02-21 19:53:51 +01:00
|
|
|
16. Improved error message in pcre2test when setting the stack size (-S) fails.
|
|
|
|
|
2015-02-26 18:36:29 +01: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 13:35:28 +01:00
|
|
|
of PCRE2 sources, which caused a failure to build pcre2test.
|
|
|
|
|
2015-02-26 18:36:29 +01:00
|
|
|
18. Fixed typo in pcre2_serialize.c (DECL instead of DEFN) that causes problems
|
2015-02-24 15:21:28 +01:00
|
|
|
only on Windows.
|
|
|
|
|
2015-02-25 18:19:28 +01: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 16:08:29 +01:00
|
|
|
21. "make distclean" was not removing config.h, a file that may be created for
|
|
|
|
use with CMake.
|
2015-02-26 18:20:48 +01:00
|
|
|
|
2015-02-28 12:31:51 +01: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 11:21:34 +01:00
|
|
|
FortiGuard Labs. (Added 24-March-2015: CVE-2015-2325 was given to this.)
|
2015-02-28 12:31:51 +01:00
|
|
|
|
2015-03-01 19:34:05 +01: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 11:21:34 +01:00
|
|
|
discovered by Kai Lu of Fortinet's FortiGuard Labs. (Added 24-March-2015:
|
|
|
|
CVE-2015-2326 was given to this.)
|
2015-03-01 19:34:05 +01:00
|
|
|
|
2015-03-06 08:57:23 +01: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 12:57:06 +01: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 17:01:24 +01:00
|
|
|
|
2015-01-23 17:51:47 +01:00
|
|
|
Version 10.00 05-January-2015
|
2015-01-05 17:02:11 +01:00
|
|
|
-----------------------------
|
2014-08-26 17:41:31 +02:00
|
|
|
|
2014-11-24 16:31:28 +01: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 17:41:31 +02:00
|
|
|
|
2014-10-20 19:28:49 +02: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 18:21:17 +02:00
|
|
|
behaviour that were implemented after the code had been forked.
|
2014-08-26 17:41:31 +02:00
|
|
|
|
2015-01-23 17:51:47 +01: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 19:27:56 +01:00
|
|
|
|
|
|
|
2. The test program, now called pcre2test, was re-specified and almost
|
2014-08-26 17:41:31 +02:00
|
|
|
completely re-written. Its input is not compatible with input for pcretest.
|
|
|
|
|
2014-11-03 19:27:56 +01:00
|
|
|
3. Patterns may start with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) to set the
|
2014-10-20 19:28:49 +02:00
|
|
|
PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART options for every subject line that is
|
2014-08-26 17:41:31 +02:00
|
|
|
matched by that pattern.
|
|
|
|
|
2014-11-03 19:27:56 +01:00
|
|
|
4. For the benefit of those who use PCRE2 via some other application, that is,
|
2014-10-20 19:28:49 +02:00
|
|
|
not writing the function calls themselves, it is possible to check the PCRE2
|
2014-11-24 16:31:28 +01:00
|
|
|
version by matching a pattern such as /(?(VERSION>=10)yes|no)/ against a
|
2014-08-26 17:41:31 +02:00
|
|
|
string such as "yesno".
|
|
|
|
|
2014-11-03 19:27:56 +01:00
|
|
|
5. There are case-equivalent Unicode characters whose encodings use different
|
2014-10-20 19:28:49 +02: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 18:59:56 +02:00
|
|
|
the match a backtrack occurred, the subject might be backtracked by the wrong
|
2014-10-20 19:28:49 +02: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 18:59:56 +02:00
|
|
|
capture the final character, which is the three bytes E2, B1, and A5 in UTF-8.
|
2014-10-20 19:28:49 +02: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 18:59:56 +02:00
|
|
|
strings matched by the repetition are not all the same length.
|
|
|
|
|
2014-11-03 19:27:56 +01:00
|
|
|
6. A pattern such as /()a/ was not setting the "first character must be 'a'"
|
2014-10-20 19:28:49 +02:00
|
|
|
information. This applied to any pattern with a group that matched no
|
2014-08-30 18:21:17 +02:00
|
|
|
characters, for example: /(?:(?=.)|(?<!x))a/.
|
|
|
|
|
2014-11-05 17:05:19 +01: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 16:31:28 +01:00
|
|
|
it was failing to mark any other groups between the highest capture so far and
|
2014-11-05 17:05:19 +01: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 19:41:20 +01:00
|
|
|
8. The pcre2_substitute() function has been implemented.
|
|
|
|
|
2014-11-24 16:31:28 +01: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 12:17:20 +01:00
|
|
|
|
2015-01-02 18:09:16 +01:00
|
|
|
10. The PCRE2_NO_DOTSTAR_ANCHOR option has been implemented.
|
|
|
|
|
2014-08-26 17:41:31 +02:00
|
|
|
****
|