Make erroroffset initializion in a POSIX wrapper thread-safe

This commit is contained in:
Petr Písař 2020-02-12 10:31:14 +01:00
parent 152a38007e
commit ad61728b83
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 3564d44ed1e70f1bf1e85b75274699b6720792ff Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Mon, 10 Feb 2020 17:01:27 +0000
Subject: [PATCH] Minor fix to avoid sanitizer complaint in POSIX wrapper.
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@1760 2f5784b3-3f2a-0410-8824-cb99058d5e15
Petr Písař: Ported to 8.43.
---
pcreposix.c | 5 ++---
diff --git a/pcreposix.c b/pcreposix.c
index a76d6bf..3042d76 100644
--- a/pcreposix.c
+++ b/pcreposix.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2018 University of Cambridge
+ Copyright (c) 1997-2020 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -298,6 +298,7 @@ if (preg->re_pcre == NULL)
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
&re_nsub);
preg->re_nsub = (size_t)re_nsub;
+preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */
return 0;
}
@@ -335,8 +336,6 @@ if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY;
-((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */
-
/* When no string data is being returned, or no vector has been passed in which
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding
the return data is large enough. */
--
2.21.1

View File

@ -2,7 +2,7 @@
#%%global rcversion RC1
Name: pcre
Version: 8.43
Release: %{?rcversion:0.}2%{?rcversion:.%rcversion}%{?dist}.2
Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist}
%global myversion %{version}%{?rcversion:-%rcversion}
Summary: Perl-compatible regular expression library
## Source package only:
@ -43,6 +43,9 @@ Patch3: pcre-8.42-Declare-POSIX-regex-function-names-as-macros-to-PCRE.patch
# Add (*LF) to a list of start-of-pattern options in the C++ wrapper,
# upstream bug #2400, in upstream after 8.43
Patch4: pcre-8.43-Fix-omission-of-LF-from-list-in-the-C-wrapper.patch
# Make erroroffset initializion in a POSIX wrapper thread-safe,
# upstream bug #2447, in upstream after 8.43
Patch5: pcre-8.43-Minor-fix-to-avoid-sanitizer-complaint-in-POSIX-wrap.patch
BuildRequires: readline-devel
BuildRequires: autoconf
BuildRequires: automake
@ -129,6 +132,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
%patch2 -p2
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Because of rpath patch
libtoolize --copy --force
autoreconf -vif
@ -228,6 +232,10 @@ make %{?_smp_mflags} check VERBOSE=yes
%{_mandir}/man1/pcretest.*
%changelog
* Wed Feb 12 2020 Petr Pisar <ppisar@redhat.com> - 8.43-3
- Make erroroffset initializion in a POSIX wrapper thread-safe
(upstream bug #2447)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.43-2.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild