Fix NULL pointer derefernce in pcre_free_study()

This commit is contained in:
Petr Písař 2012-01-02 12:34:42 +01:00
parent 404ec67656
commit 8c176900e5
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 7ff6515c706e881fe1388576e79d52243e290958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 2 Jan 2012 12:27:29 +0100
Subject: [PATCH] Do not dereference NULL argument of pcre_free_study()
Back-ported from:
r836 | ph10 | 2011-12-28 18:16:11 +0100 (St, 28 pro 2011) | 2 lines
Merging all the changes from the pcre16 branch into the trunk.
Upstream bug #1186.
---
pcre_study.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pcre_study.c b/pcre_study.c
index cb2f23e..0a3ecbc 100644
--- a/pcre_study.c
+++ b/pcre_study.c
@@ -1377,6 +1377,8 @@ Returns: nothing
PCRE_EXP_DEFN void
pcre_free_study(pcre_extra *extra)
{
+if (extra == NULL)
+ return;
#ifdef SUPPORT_JIT
if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
extra->executable_jit != NULL)
--
1.7.7.5

View File

@ -15,6 +15,8 @@ Patch0: pcre-8.21-multilib.patch
Patch1: pcre-8.20-refused_spelling_terminated.patch
# Bug #769597, fixed by upstream after 8.21.
Patch2: pcre-8.21-Do-not-make-unmatched-subpattern-wildcard.patch
# Upstream bug #1186, fixed by upstream after 8.21.
Patch3: pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch
BuildRequires: readline-devel
# New libtool to get rid of rpath
BuildRequires: autoconf, automake, libtool
@ -56,6 +58,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
libtoolize --copy --force && autoreconf
%patch1 -p1 -b .terminated_typos
%patch2 -p1 -b .unmatched_subpattern
%patch3 -p1 -b .null_pcre_free_study
# One contributor's name is non-UTF-8
for F in ChangeLog; do
iconv -f latin1 -t utf8 "$F" >"${F}.utf8"
@ -128,6 +131,7 @@ make check
%changelog
* Mon Jan 02 2012 Petr Pisar <ppisar@redhat.com> - 8.21-2
- Fix unmatched subpattern to not become wildcard (bug #769597)
- Fix NULL pointer derefernce in pcre_free_study() (upstream bug #1186)
* Mon Dec 12 2011 Petr Pisar <ppisar@redhat.com> - 8.21-1
- 8.21 bump