summaryrefslogtreecommitdiffstats
path: root/0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-07-15 15:47:22 +0200
committerRemi Collet <remi@remirepo.net>2019-07-15 15:47:22 +0200
commit558251d3ce37b751b4d3e263577e4252b441a92b (patch)
treedd3ff28d074ba25c8b52e5155476a4167c160631 /0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch
parent7af69d0e975f27cd4141ebf2f365032ac17c5150 (diff)
add security fixes from Fedora
Diffstat (limited to '0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch')
-rw-r--r--0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch b/0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch
new file mode 100644
index 0000000..6567d25
--- /dev/null
+++ b/0101-onig_new_deluxe-don-t-free-new-pattern-if-success.patch
@@ -0,0 +1,27 @@
+From 4a8db9d50f8281930678ed6f06692545293f3c9d Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka@fedoraproject.org>
+Date: Fri, 12 Jul 2019 15:38:43 +0900
+Subject: [PATCH] onig_new_deluxe: don't free new pattern if success
+
+On onig_new_deluxe() success (r == 0), new pattern (cpat) is used in
+einfo->pattern, so don't free this.
+---
+ src/regext.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/regext.c b/src/regext.c
+index fa4b360..920d183 100644
+--- a/src/regext.c
++++ b/src/regext.c
+@@ -196,7 +196,7 @@ onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
+ }
+
+ err2:
+- if (cpat != pattern) xfree(cpat);
++ if (r && (cpat != pattern)) xfree(cpat);
+
+ return r;
+ }
+--
+2.21.0
+