Skip to content

Commit 1592fbd

Browse files
committed
8.39
1 parent e7591a1 commit 1592fbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5887
-4468
lines changed

pcre/AUTHORS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
88
University of Cambridge Computing Service,
99
Cambridge, England.
1010

11-
Copyright (c) 1997-2015 University of Cambridge
11+
Copyright (c) 1997-2016 University of Cambridge
1212
All rights reserved
1313

1414

@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
1919
Email local part: hzmester
2020
Emain domain: freemail.hu
2121

22-
Copyright(c) 2010-2015 Zoltan Herczeg
22+
Copyright(c) 2010-2016 Zoltan Herczeg
2323
All rights reserved.
2424

2525

@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
3030
Email local part: hzmester
3131
Emain domain: freemail.hu
3232

33-
Copyright(c) 2009-2015 Zoltan Herczeg
33+
Copyright(c) 2009-2016 Zoltan Herczeg
3434
All rights reserved.
3535

3636

pcre/CMakeLists.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@
6565
# so it has been removed.
6666
# 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
6767
# 2013-11-05 PH added support for PARENS_NEST_LIMIT
68+
# 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
6869

6970
PROJECT(PCRE C CXX)
7071

71-
# Increased minimum to 2.8.0 to support newer add_test features
72+
# Increased minimum to 2.8.0 to support newer add_test features. Set policy
73+
# CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.
7274

7375
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
76+
CMAKE_POLICY(SET CMP0026 OLD)
7477

7578
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
7679

@@ -567,6 +570,20 @@ SET(PCREPOSIX_SOURCES
567570
ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc)
568571
ENDIF(MSVC AND NOT PCRE_STATIC)
569572

573+
# Fix static compilation with MSVC: https://bugs.exim.org/show_bug.cgi?id=1681
574+
# This code was taken from the CMake wiki, not from WebM.
575+
576+
IF(MSVC AND PCRE_STATIC)
577+
MESSAGE(STATUS "** MSVC and PCRE_STATIC: modifying compiler flags to use static runtime library")
578+
foreach(flag_var
579+
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
580+
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
581+
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
582+
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
583+
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
584+
endforeach()
585+
ENDIF(MSVC AND PCRE_STATIC)
586+
570587
SET(PCRECPP_HEADERS
571588
pcrecpp.h
572589
pcre_scanner.h

pcre/ChangeLog

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,104 @@ ChangeLog for PCRE
44
Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All
55
development is happening in the PCRE2 10.xx series.
66

7+
Version 8.39 14-June-2016
8+
-------------------------
9+
10+
1. If PCRE_AUTO_CALLOUT was set on a pattern that had a (?# comment between
11+
an item and its qualifier (for example, A(?#comment)?B) pcre_compile()
12+
misbehaved. This bug was found by the LLVM fuzzer.
13+
14+
2. Similar to the above, if an isolated \E was present between an item and its
15+
qualifier when PCRE_AUTO_CALLOUT was set, pcre_compile() misbehaved. This
16+
bug was found by the LLVM fuzzer.
17+
18+
3. Further to 8.38/46, negated classes such as [^[:^ascii:]\d] were also not
19+
working correctly in UCP mode.
20+
21+
4. The POSIX wrapper function regexec() crashed if the option REG_STARTEND
22+
was set when the pmatch argument was NULL. It now returns REG_INVARG.
23+
24+
5. Allow for up to 32-bit numbers in the ordin() function in pcregrep.
25+
26+
6. An empty \Q\E sequence between an item and its qualifier caused
27+
pcre_compile() to misbehave when auto callouts were enabled. This bug was
28+
found by the LLVM fuzzer.
29+
30+
7. If a pattern that was compiled with PCRE_EXTENDED started with white
31+
space or a #-type comment that was followed by (?-x), which turns off
32+
PCRE_EXTENDED, and there was no subsequent (?x) to turn it on again,
33+
pcre_compile() assumed that (?-x) applied to the whole pattern and
34+
consequently mis-compiled it. This bug was found by the LLVM fuzzer.
35+
36+
8. A call of pcre_copy_named_substring() for a named substring whose number
37+
was greater than the space in the ovector could cause a crash.
38+
39+
9. Yet another buffer overflow bug involved duplicate named groups with a
40+
group that reset capture numbers (compare 8.38/7 below). Once again, I have
41+
just allowed for more memory, even if not needed. (A proper fix is
42+
implemented in PCRE2, but it involves a lot of refactoring.)
43+
44+
10. pcre_get_substring_list() crashed if the use of \K in a match caused the
45+
start of the match to be earlier than the end.
46+
47+
11. Migrating appropriate PCRE2 JIT improvements to PCRE.
48+
49+
12. A pattern such as /(?<=((?C)0))/, which has a callout inside a lookbehind
50+
assertion, caused pcretest to generate incorrect output, and also to read
51+
uninitialized memory (detected by ASAN or valgrind).
52+
53+
13. A pattern that included (*ACCEPT) in the middle of a sufficiently deeply
54+
nested set of parentheses of sufficient size caused an overflow of the
55+
compiling workspace (which was diagnosed, but of course is not desirable).
56+
57+
14. And yet another buffer overflow bug involving duplicate named groups, this
58+
time nested, with a nested back reference. Yet again, I have just allowed
59+
for more memory, because anything more needs all the refactoring that has
60+
been done for PCRE2. An example pattern that provoked this bug is:
61+
/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ and the bug was
62+
registered as CVE-2016-1283.
63+
64+
15. pcretest went into a loop if global matching was requested with an ovector
65+
size less than 2. It now gives an error message. This bug was found by
66+
afl-fuzz.
67+
68+
16. An invalid pattern fragment such as (?(?C)0 was not diagnosing an error
69+
("assertion expected") when (?(?C) was not followed by an opening
70+
parenthesis.
71+
72+
17. Fixed typo ("&&" for "&") in pcre_study(). Fortunately, this could not
73+
actually affect anything, by sheer luck.
74+
75+
18. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC
76+
static compilation.
77+
78+
19. Modified the RunTest script to incorporate a valgrind suppressions file so
79+
that certain errors, provoked by the SSE2 instruction set when JIT is used,
80+
are ignored.
81+
82+
20. A racing condition is fixed in JIT reported by Mozilla.
83+
84+
21. Minor code refactor to avoid "array subscript is below array bounds"
85+
compiler warning.
86+
87+
22. Minor code refactor to avoid "left shift of negative number" warning.
88+
89+
23. Fix typo causing compile error when 16- or 32-bit JIT is compiled without
90+
UCP support.
91+
92+
24. Refactor to avoid compiler warnings in pcrecpp.cc.
93+
94+
25. Refactor to fix a typo in pcre_jit_test.c
95+
96+
26. Patch to support compiling pcrecpp.cc with Intel compiler.
97+
98+
799
Version 8.38 23-November-2015
8100
-----------------------------
9101

10102
1. If a group that contained a recursive back reference also contained a
11103
forward reference subroutine call followed by a non-forward-reference
12-
subroutine call, for example /.((?2)(?R)\1)()/, pcre2_compile() failed to
104+
subroutine call, for example /.((?2)(?R)\1)()/, pcre_compile() failed to
13105
compile correct code, leading to undefined behaviour or an internally
14106
detected error. This bug was discovered by the LLVM fuzzer.
15107

pcre/LICENCE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Email domain: cam.ac.uk
2525
University of Cambridge Computing Service,
2626
Cambridge, England.
2727

28-
Copyright (c) 1997-2015 University of Cambridge
28+
Copyright (c) 1997-2016 University of Cambridge
2929
All rights reserved.
3030

3131

@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
3636
Email local part: hzmester
3737
Emain domain: freemail.hu
3838

39-
Copyright(c) 2010-2015 Zoltan Herczeg
39+
Copyright(c) 2010-2016 Zoltan Herczeg
4040
All rights reserved.
4141

4242

@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
4747
Email local part: hzmester
4848
Emain domain: freemail.hu
4949

50-
Copyright(c) 2009-2015 Zoltan Herczeg
50+
Copyright(c) 2009-2016 Zoltan Herczeg
5151
All rights reserved.
5252

5353

pcre/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ EXTRA_DIST += \
613613
testdata/testoutput25 \
614614
testdata/testoutput26 \
615615
testdata/testoutputEBC \
616+
testdata/valgrind-jit.supp \
616617
testdata/wintestinput3 \
617618
testdata/wintestoutput3 \
618619
perltest.pl

pcre/Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,9 +1070,9 @@ EXTRA_DIST = m4/ax_pthread.m4 m4/pcre_visibility.m4 doc/perltest.txt \
10701070
testdata/testoutput22-16 testdata/testoutput22-32 \
10711071
testdata/testoutput23 testdata/testoutput24 \
10721072
testdata/testoutput25 testdata/testoutput26 \
1073-
testdata/testoutputEBC testdata/wintestinput3 \
1074-
testdata/wintestoutput3 perltest.pl pcredemo.c $(pcrecpp_man) \
1075-
cmake/COPYING-CMAKE-SCRIPTS \
1073+
testdata/testoutputEBC testdata/valgrind-jit.supp \
1074+
testdata/wintestinput3 testdata/wintestoutput3 perltest.pl \
1075+
pcredemo.c $(pcrecpp_man) cmake/COPYING-CMAKE-SCRIPTS \
10761076
cmake/FindPackageHandleStandardArgs.cmake \
10771077
cmake/FindReadline.cmake cmake/FindEditline.cmake \
10781078
CMakeLists.txt config-cmake.h.in

pcre/NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
News about PCRE releases
22
------------------------
33

4+
Release 8.39 14-June-2016
5+
-------------------------
6+
7+
Some appropriate PCRE2 JIT improvements have been retro-fitted to PCRE1. Apart
8+
from that, this is another bug-fix release. Note that this library (now called
9+
PCRE1) is now being maintained for bug fixes only. New projects are advised to
10+
use the new PCRE2 libraries.
11+
12+
413
Release 8.38 23-November-2015
514
-----------------------------
615

pcre/RunGrepTest

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ fi
6767
./pcretest -C utf >/dev/null
6868
utf8=$?
6969

70+
# We need valgrind suppressions when JIT is in use. (This isn't perfect because
71+
# some tests are run with -no-jit, but as PCRE1 is in maintenance only, I have
72+
# not bothered about that.)
73+
74+
./pcretest -C jit >/dev/null
75+
if [ $? -eq 1 -a "$valgrind" != "" ] ; then
76+
valgrind="$valgrind --suppressions=./testdata/valgrind-jit.supp"
77+
fi
78+
7079
echo "Testing pcregrep main features"
7180

7281
echo "---------------------------- Test 1 ------------------------------" >testtrygrep

pcre/RunTest

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ nojit=
178178
sim=
179179
skip=
180180
valgrind=
181+
vjs=
181182

182183
# This is in case the caller has set aliases (as I do - PH)
183184
unset cp ls mv rm
@@ -357,6 +358,9 @@ $sim ./pcretest -C jit >/dev/null
357358
jit=$?
358359
if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
359360
jitopt=-s+
361+
if [ "$valgrind" != "" ] ; then
362+
vjs="--suppressions=$testdata/valgrind-jit.supp"
363+
fi
360364
fi
361365

362366
# If no specific tests were requested, select all. Those that are not
@@ -423,7 +427,7 @@ for bmode in "$test8" "$test16" "$test32"; do
423427
if [ $do1 = yes ] ; then
424428
echo $title1
425429
for opt in "" "-s" $jitopt; do
426-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
430+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput1 testtry
427431
if [ $? = 0 ] ; then
428432
$cf $testdata/testoutput1 testtry
429433
if [ $? != 0 ] ; then exit 1; fi
@@ -441,7 +445,7 @@ fi
441445
if [ $do2 = yes ] ; then
442446
echo $title2 "(not UTF-$bits)"
443447
for opt in "" "-s" $jitopt; do
444-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
448+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput2 testtry
445449
if [ $? = 0 ] ; then
446450
$cf $testdata/testoutput2 testtry
447451
if [ $? != 0 ] ; then exit 1; fi
@@ -504,7 +508,7 @@ if [ $do3 = yes ] ; then
504508
if [ "$locale" != "" ] ; then
505509
echo $title3 "(using '$locale' locale)"
506510
for opt in "" "-s" $jitopt; do
507-
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry
511+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $infile testtry
508512
if [ $? = 0 ] ; then
509513
if $cf $outfile testtry >teststdout || \
510514
$cf $outfile2 testtry >teststdout || \
@@ -540,7 +544,7 @@ if [ $do4 = yes ] ; then
540544
echo " Skipped because UTF-$bits support is not available"
541545
else
542546
for opt in "" "-s" $jitopt; do
543-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
547+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput4 testtry
544548
if [ $? = 0 ] ; then
545549
$cf $testdata/testoutput4 testtry
546550
if [ $? != 0 ] ; then exit 1; fi
@@ -560,7 +564,7 @@ if [ $do5 = yes ] ; then
560564
echo " Skipped because UTF-$bits support is not available"
561565
else
562566
for opt in "" "-s" $jitopt; do
563-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
567+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput5 testtry
564568
if [ $? = 0 ] ; then
565569
$cf $testdata/testoutput5 testtry
566570
if [ $? != 0 ] ; then exit 1; fi
@@ -580,7 +584,7 @@ if [ $do6 = yes ] ; then
580584
echo " Skipped because Unicode property support is not available"
581585
else
582586
for opt in "" "-s" $jitopt; do
583-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
587+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput6 testtry
584588
if [ $? = 0 ] ; then
585589
$cf $testdata/testoutput6 testtry
586590
if [ $? != 0 ] ; then exit 1; fi
@@ -602,7 +606,7 @@ if [ $do7 = yes ] ; then
602606
echo " Skipped because Unicode property support is not available"
603607
else
604608
for opt in "" "-s" $jitopt; do
605-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
609+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput7 testtry
606610
if [ $? = 0 ] ; then
607611
$cf $testdata/testoutput7 testtry
608612
if [ $? != 0 ] ; then exit 1; fi
@@ -698,7 +702,7 @@ if [ $do12 = yes ] ; then
698702
if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
699703
echo " Skipped because JIT is not available or not usable"
700704
else
701-
$sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
705+
$sim $valgrind $vjs ./pcretest -q $bmode $testdata/testinput12 testtry
702706
if [ $? = 0 ] ; then
703707
$cf $testdata/testoutput12 testtry
704708
if [ $? != 0 ] ; then exit 1; fi
@@ -735,7 +739,7 @@ if [ "$do14" = yes ] ; then
735739
cp -f $testdata/saved16 testsaved16
736740
cp -f $testdata/saved32 testsaved32
737741
for opt in "" "-s" $jitopt; do
738-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
742+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput14 testtry
739743
if [ $? = 0 ] ; then
740744
$cf $testdata/testoutput14 testtry
741745
if [ $? != 0 ] ; then exit 1; fi
@@ -759,7 +763,7 @@ if [ "$do15" = yes ] ; then
759763
echo " Skipped because UTF-$bits support is not available"
760764
else
761765
for opt in "" "-s" $jitopt; do
762-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
766+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput15 testtry
763767
if [ $? = 0 ] ; then
764768
$cf $testdata/testoutput15 testtry
765769
if [ $? != 0 ] ; then exit 1; fi
@@ -783,7 +787,7 @@ if [ $do16 = yes ] ; then
783787
echo " Skipped because Unicode property support is not available"
784788
else
785789
for opt in "" "-s" $jitopt; do
786-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
790+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput16 testtry
787791
if [ $? = 0 ] ; then
788792
$cf $testdata/testoutput16 testtry
789793
if [ $? != 0 ] ; then exit 1; fi
@@ -805,7 +809,7 @@ if [ $do17 = yes ] ; then
805809
echo " Skipped when running 8-bit tests"
806810
else
807811
for opt in "" "-s" $jitopt; do
808-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
812+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput17 testtry
809813
if [ $? = 0 ] ; then
810814
$cf $testdata/testoutput17 testtry
811815
if [ $? != 0 ] ; then exit 1; fi
@@ -829,7 +833,7 @@ if [ $do18 = yes ] ; then
829833
echo " Skipped because UTF-$bits support is not available"
830834
else
831835
for opt in "" "-s" $jitopt; do
832-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
836+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput18 testtry
833837
if [ $? = 0 ] ; then
834838
$cf $testdata/testoutput18-$bits testtry
835839
if [ $? != 0 ] ; then exit 1; fi
@@ -853,7 +857,7 @@ if [ $do19 = yes ] ; then
853857
echo " Skipped because Unicode property support is not available"
854858
else
855859
for opt in "" "-s" $jitopt; do
856-
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
860+
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput19 testtry
857861
if [ $? = 0 ] ; then
858862
$cf $testdata/testoutput19 testtry
859863
if [ $? != 0 ] ; then exit 1; fi

0 commit comments

Comments
 (0)