8.42 bump

This commit is contained in:
Petr Písař 2018-03-20 14:09:18 +01:00
parent 8bdb17a13b
commit d1e3f6368e
4 changed files with 7 additions and 76 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ pcre-8.10.tar.bz2
/pcre-8.41-RC1.tar.bz2
/pcre-8.41.tar.bz2
/pcre-8.42-RC1.tar.bz2
/pcre-8.42.tar.bz2

View File

@ -1,70 +0,0 @@
From 25ba46be7b2732a4e1fb272208d15c12807fd0ae Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Sun, 25 Feb 2018 12:23:55 +0000
Subject: [PATCH] A small fix to pcregrep to avoid compiler warnings for
-Wformat-overflow=2.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1727 2f5784b3-3f2a-0410-8824-cb99058d5e15
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
ChangeLog | 2 ++
pcregrep.c | 20 +++++++++++++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5d1a4d9..a8cf378 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,8 @@ containing multi-code-unit characters caused bad behaviour and possibly a
crash. This issue was fixed for other kinds of repeat in release 8.37 by change
38, but repeating character classes were overlooked.
+6. A small fix to pcregrep to avoid compiler warnings for -Wformat-overflow=2.
+
Version 8.41 05-July-2017
-------------------------
diff --git a/pcregrep.c b/pcregrep.c
index 69ba85a..a406be9 100644
--- a/pcregrep.c
+++ b/pcregrep.c
@@ -2527,7 +2527,14 @@ if ((popts & PO_FIXED_STRINGS) != 0)
}
}
-sprintf(buffer, "%s%.*s%s", prefix[popts], patlen, ps, suffix[popts]);
+if (snprintf(buffer, PATBUFSIZE, "%s%.*s%s", prefix[popts], patlen, ps,
+ suffix[popts]) > PATBUFSIZE)
+ {
+ fprintf(stderr, "pcregrep: Buffer overflow while compiling \"%s\"\n",
+ ps);
+ return FALSE;
+ }
+
p->compiled = pcre_compile(buffer, options, &error, &errptr, pcretables);
if (p->compiled != NULL) return TRUE;
@@ -2763,8 +2770,15 @@ for (i = 1; i < argc; i++)
int arglen = (argequals == NULL || equals == NULL)?
(int)strlen(arg) : (int)(argequals - arg);
- sprintf(buff1, "%.*s", baselen, op->long_name);
- sprintf(buff2, "%s%.*s", buff1, fulllen - baselen - 2, opbra + 1);
+ if (snprintf(buff1, sizeof(buff1), "%.*s", baselen, op->long_name) >
+ (int)sizeof(buff1) ||
+ snprintf(buff2, sizeof(buff2), "%s%.*s", buff1,
+ fulllen - baselen - 2, opbra + 1) > (int)sizeof(buff2))
+ {
+ fprintf(stderr, "pcregrep: Buffer overflow when parsing %s option\n",
+ op->long_name);
+ pcregrep_exit(2);
+ }
if (strncmp(arg, buff1, arglen) == 0 ||
strncmp(arg, buff2, arglen) == 0)
--
2.13.6

View File

@ -1,8 +1,8 @@
# Is this a stable/testing release:
%global rcversion RC1
#%%global rcversion RC1
Name: pcre
Version: 8.42
Release: %{?rcversion:0.}2%{?rcversion:.%rcversion}%{?dist}
Release: %{?rcversion:0.}1%{?rcversion:.%rcversion}%{?dist}
%global myversion %{version}%{?rcversion:-%rcversion}
Summary: Perl-compatible regular expression library
## Source package only:
@ -35,8 +35,6 @@ Patch0: pcre-8.21-multilib.patch
Patch1: pcre-8.32-refused_spelling_terminated.patch
# Fix recursion stack estimator, upstream bug #2173, refused by upstream
Patch2: pcre-8.41-fix_stack_estimator.patch
# Fix compiler warnings in pcregrep, in upstream after 8.42-RC1
Patch3: pcre-8.42-RC1-A-small-fix-to-pcregrep-to-avoid-compiler-warnings-f.patch
BuildRequires: readline-devel
BuildRequires: autoconf
BuildRequires: automake
@ -121,7 +119,6 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
%patch0 -p1
%patch1 -p1
%patch2 -p2
%patch3 -p1
# Because of rpath patch
libtoolize --copy --force
autoreconf -vif
@ -216,6 +213,9 @@ make %{?_smp_mflags} check VERBOSE=yes
%{_mandir}/man1/pcretest.*
%changelog
* Tue Mar 20 2018 Petr Pisar <ppisar@redhat.com> - 8.42-1
- 8.42 bump
* Mon Feb 26 2018 Petr Pisar <ppisar@redhat.com> - 8.42-0.2.RC1
- Fix compiler warnings in pcregrep

View File

@ -1 +1 @@
SHA512 (pcre-8.42-RC1.tar.bz2) = 9569246c992f70be8563c90103402feb04645bb821b96634e2af98001f6614201907f052cfb50c73f99976214f373acc331d97a265a437def06b669a21acb8b6
SHA512 (pcre-8.42.tar.bz2) = b47b923108f6ee0c31409b79d0888314271b482a22590e164d02f21d2112fba22dd0342c24f9ba0f5fcc5b8c65550bad08c476e30a2fc79b34ecf4601ed82f3d