[pcre] Fix NULL pointer derefernce in pcre_free_study()
Petr Pisar
ppisar at fedoraproject.org
Mon Jan 2 11:54:54 UTC 2012
commit 8c176900e5d7a422fd40c8d2edb1bb70c0e6b0d2
Author: Petr Písař <ppisar at redhat.com>
Date: Mon Jan 2 12:34:42 2012 +0100
Fix NULL pointer derefernce in pcre_free_study()
...eference-NULL-argument-of-pcre_free_study.patch | 30 ++++++++++++++++++++
pcre.spec | 4 ++
2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch b/pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch
new file mode 100644
index 0000000..6349b4e
--- /dev/null
+++ b/pcre-8.21-Do-not-dereference-NULL-argument-of-pcre_free_study.patch
@@ -0,0 +1,30 @@
+From 7ff6515c706e881fe1388576e79d52243e290958 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at 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
+
diff --git a/pcre.spec b/pcre.spec
index 0655b97..9f52cc3 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -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 at 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 at redhat.com> - 8.21-1
- 8.21 bump
More information about the scm-commits
mailing list