Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
839fcb523f | ||
|
|
4478d244b7 |
5 changed files with 84 additions and 53 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,4 +1 @@
|
|||
onig-5.9.2.tar.gz
|
||||
/onig-5.9.3.tar.gz
|
||||
/onig-5.9.4.tar.gz
|
||||
/onig-5.9.5.tar.gz
|
||||
onig-*.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
--- onig-5.9.2/regcomp.c.debug 2010-01-05 23:13:38.000000000 +0900
|
||||
+++ onig-5.9.2/regcomp.c 2010-01-15 03:58:15.000000000 +0900
|
||||
@@ -5536,19 +5536,22 @@
|
||||
OnigErrorInfo* einfo)
|
||||
{
|
||||
int r;
|
||||
+ regex_t *regg;
|
||||
|
||||
- *reg = (regex_t* )xmalloc(sizeof(regex_t));
|
||||
- if (IS_NULL(*reg)) return ONIGERR_MEMORY;
|
||||
+ regg = (regex_t* )xmalloc(sizeof(regex_t));
|
||||
+ if (IS_NULL(regg)) return ONIGERR_MEMORY;
|
||||
|
||||
- r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
|
||||
+ r = onig_reg_init(regg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
|
||||
if (r) goto err;
|
||||
|
||||
- r = onig_compile(*reg, pattern, pattern_end, einfo);
|
||||
+ r = onig_compile(regg, pattern, pattern_end, einfo);
|
||||
if (r) {
|
||||
err:
|
||||
- onig_free(*reg);
|
||||
- *reg = NULL;
|
||||
+ onig_free(regg);
|
||||
+ regg = NULL;
|
||||
}
|
||||
+
|
||||
+ *reg = regg;
|
||||
return r;
|
||||
}
|
||||
|
||||
57
oniguruma-6.8.2-CVE-2019-13225-fix.patch
Normal file
57
oniguruma-6.8.2-CVE-2019-13225-fix.patch
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
diff --git a/src/regcomp.c b/src/regcomp.c
|
||||
index f953ed1..ae2caeb 100644
|
||||
--- a/src/regcomp.c
|
||||
+++ b/src/regcomp.c
|
||||
@@ -1131,8 +1131,9 @@ compile_length_enclosure_node(EnclosureNode* node, regex_t* reg)
|
||||
len += tlen;
|
||||
}
|
||||
|
||||
+ len += SIZE_OP_JUMP + SIZE_OP_ATOMIC_END;
|
||||
+
|
||||
if (IS_NOT_NULL(Else)) {
|
||||
- len += SIZE_OP_JUMP;
|
||||
tlen = compile_length_tree(Else, reg);
|
||||
if (tlen < 0) return tlen;
|
||||
len += tlen;
|
||||
@@ -1274,7 +1275,7 @@ compile_enclosure_node(EnclosureNode* node, regex_t* reg, ScanEnv* env)
|
||||
|
||||
case ENCLOSURE_IF_ELSE:
|
||||
{
|
||||
- int cond_len, then_len, jump_len;
|
||||
+ int cond_len, then_len, else_len, jump_len;
|
||||
Node* cond = NODE_ENCLOSURE_BODY(node);
|
||||
Node* Then = node->te.Then;
|
||||
Node* Else = node->te.Else;
|
||||
@@ -1291,8 +1292,7 @@ compile_enclosure_node(EnclosureNode* node, regex_t* reg, ScanEnv* env)
|
||||
else
|
||||
then_len = 0;
|
||||
|
||||
- jump_len = cond_len + then_len + SIZE_OP_ATOMIC_END;
|
||||
- if (IS_NOT_NULL(Else)) jump_len += SIZE_OP_JUMP;
|
||||
+ jump_len = cond_len + then_len + SIZE_OP_ATOMIC_END + SIZE_OP_JUMP;
|
||||
|
||||
r = add_opcode_rel_addr(reg, OP_PUSH, jump_len);
|
||||
if (r != 0) return r;
|
||||
@@ -1307,9 +1307,19 @@ compile_enclosure_node(EnclosureNode* node, regex_t* reg, ScanEnv* env)
|
||||
}
|
||||
|
||||
if (IS_NOT_NULL(Else)) {
|
||||
- int else_len = compile_length_tree(Else, reg);
|
||||
- r = add_opcode_rel_addr(reg, OP_JUMP, else_len);
|
||||
- if (r != 0) return r;
|
||||
+ else_len = compile_length_tree(Else, reg);
|
||||
+ if (else_len < 0) return else_len;
|
||||
+ }
|
||||
+ else
|
||||
+ else_len = 0;
|
||||
+
|
||||
+ r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_ATOMIC_END + else_len);
|
||||
+ if (r != 0) return r;
|
||||
+
|
||||
+ r = add_opcode(reg, OP_ATOMIC_END);
|
||||
+ if (r != 0) return r;
|
||||
+
|
||||
+ if (IS_NOT_NULL(Else)) {
|
||||
r = compile_tree(Else, reg, env);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,15 @@
|
|||
Name: oniguruma
|
||||
Version: 5.9.5
|
||||
Release: 3%{?dist}
|
||||
Version: 6.8.2
|
||||
Release: 2%{?dist}
|
||||
Summary: Regular expressions library
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: BSD
|
||||
URL: http://www.geocities.jp/kosako3/oniguruma/
|
||||
Source0: http://www.geocities.jp/kosako3/oniguruma/archive/onig-%{version}.tar.gz
|
||||
# FIXME
|
||||
# Don't know exactly why, however without Patch0 onig_new returns
|
||||
# NULL reg variable
|
||||
Patch0: oniguruma-5.9.2-onig_new-returns-NULL-reg.patch
|
||||
|
||||
BuildRequires: ruby >= 1.8
|
||||
#Requires:
|
||||
URL: https://github.com/kkos/oniguruma/
|
||||
Source0: https://github.com/kkos/oniguruma/releases/download/v%{version}/onig-%{version}.tar.gz
|
||||
# Backport https://src.fedoraproject.org/rpms/oniguruma/blob/f29/f/0100-Apply-CVE-2019-13325-fix-to-6.9.1.patch
|
||||
# (upstream: https://github.com/kkos/oniguruma/commit/c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c)
|
||||
Patch0: oniguruma-6.8.2-CVE-2019-13225-fix.patch
|
||||
|
||||
%description
|
||||
Oniguruma is a regular expressions library.
|
||||
|
|
@ -33,10 +29,10 @@ developing applications that use %{name}.
|
|||
|
||||
|
||||
%prep
|
||||
%setup -q -n onig-%{version}
|
||||
%patch0 -p1 -b .nullreg
|
||||
%autosetup -p 1 -n onig-%{version}
|
||||
%{__sed} -i.multilib -e 's|-L@libdir@||' onig-config.in
|
||||
|
||||
%if 0
|
||||
for f in \
|
||||
README.ja \
|
||||
doc/API.ja \
|
||||
|
|
@ -47,9 +43,11 @@ for f in \
|
|||
( touch -r $f $f.tmp ; %{__mv} -f $f.tmp $f ) || \
|
||||
%{__rm} -f $f.tmp
|
||||
done
|
||||
%endif
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--disable-silent-rules \
|
||||
--disable-static \
|
||||
--with-rubydir=%{_bindir}
|
||||
%{__make} %{?_smp_mflags}
|
||||
|
|
@ -73,21 +71,25 @@ find $RPM_BUILD_ROOT -name '*.la' \
|
|||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS
|
||||
%doc COPYING
|
||||
%license COPYING
|
||||
%doc HISTORY
|
||||
%doc README
|
||||
%doc README.md
|
||||
%doc index.html
|
||||
%lang(ja) %doc README.ja
|
||||
%lang(ja) %doc README_japanese
|
||||
%lang(ja) %doc index_ja.html
|
||||
|
||||
%{_libdir}/libonig.so.*
|
||||
%{_libdir}/libonig.so.5*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc doc/API
|
||||
%doc doc/CALLOUTS.API
|
||||
%doc doc/CALLOUTS.BUILTIN
|
||||
%doc doc/FAQ
|
||||
%doc doc/RE
|
||||
%lang(ja) %doc doc/API.ja
|
||||
%lang(ja) %doc doc/CALLOUTS.API.ja
|
||||
%lang(ja) %doc doc/CALLOUTS.BUILTIN.ja
|
||||
%lang(ja) %doc doc/FAQ.ja
|
||||
%lang(ja) %doc doc/RE.ja
|
||||
|
||||
|
|
@ -98,6 +100,12 @@ find $RPM_BUILD_ROOT -name '*.la' \
|
|||
%{_libdir}/pkgconfig/%{name}.pc
|
||||
|
||||
%changelog
|
||||
* Tue Jun 14 2022 Carl George <carl@george.computer> - 6.8.2-2
|
||||
- Backport fix for CVE-2019-13225 from RHEL8, resolves: rhbz#1728967
|
||||
|
||||
* Tue May 26 2020 Carl George <carl@george.computer> - 6.8.2-1
|
||||
- Rebase to 6.8.2 rhbz#1777660
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.9.5-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
970f98a4cd10021b545d84e34c34aae4 onig-5.9.5.tar.gz
|
||||
SHA512 (onig-6.8.2.tar.gz) = 1bfa6688c67b684afd558ce9f0654f484acbb733972382fccc0b3d1a05a2c2075e349d9d9c8f86371ee07221b45e5ef28ed238b5807be6fbc49d1f53b14e1596
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue