Compare commits

..

No commits in common. "7115ab3618e83994aae47f05ebaca4f62bb41049" and "821ded69bc6a530a0e962dba0504d12c60bff5df" have entirely different histories.

4 changed files with 5 additions and 117 deletions

View File

@ -1,65 +0,0 @@
From a3917d95d516e3de267d3cfa5d4d3715a90e8777 Mon Sep 17 00:00:00 2001
From: Michal Vasko <mvasko@cesnet.cz>
Date: Mon, 8 Mar 2021 14:08:05 +0100
Subject: [PATCH] yin parser BUGFIX invalid memory access
... in case there were some unresolved
extensions.
Fixes #1454
Fixes #1455
---
src/parser_yin.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 275991644..256325415 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -4572,7 +4572,7 @@ read_yin_anydata(struct lys_module *module, struct lys_node *parent, struct lyxm
for (r = 0; r < retval->ext_size; ++r) {
/* set flag, which represent LYEXT_OPT_VALID */
- if (retval->ext[r]->flags & LYEXT_OPT_VALID) {
+ if (retval->ext[r] && (retval->ext[r]->flags & LYEXT_OPT_VALID)) {
retval->flags |= LYS_VALID_EXT;
break;
}
@@ -4794,7 +4794,7 @@ read_yin_leaf(struct lys_module *module, struct lys_node *parent, struct lyxml_e
for (r = 0; r < retval->ext_size; ++r) {
/* set flag, which represent LYEXT_OPT_VALID */
- if (retval->ext[r]->flags & LYEXT_OPT_VALID) {
+ if (retval->ext[r] && (retval->ext[r]->flags & LYEXT_OPT_VALID)) {
retval->flags |= LYS_VALID_EXT;
break;
}
@@ -5108,7 +5108,7 @@ read_yin_leaflist(struct lys_module *module, struct lys_node *parent, struct lyx
for (r = 0; r < retval->ext_size; ++r) {
/* set flag, which represent LYEXT_OPT_VALID */
- if (retval->ext[r]->flags & LYEXT_OPT_VALID) {
+ if (retval->ext[r] && (retval->ext[r]->flags & LYEXT_OPT_VALID)) {
retval->flags |= LYS_VALID_EXT;
break;
}
@@ -5477,7 +5477,7 @@ read_yin_list(struct lys_module *module, struct lys_node *parent, struct lyxml_e
for (r = 0; r < retval->ext_size; ++r) {
/* set flag, which represent LYEXT_OPT_VALID */
- if (retval->ext[r]->flags & LYEXT_OPT_VALID) {
+ if (retval->ext[r] && (retval->ext[r]->flags & LYEXT_OPT_VALID)) {
retval->flags |= LYS_VALID_EXT;
if (retval->ext[r]->flags & LYEXT_OPT_VALID_SUBTREE) {
retval->flags |= LYS_VALID_EXT_SUBTREE;
@@ -5701,8 +5701,9 @@ read_yin_container(struct lys_module *module, struct lys_node *parent, struct ly
}
for (r = 0; r < retval->ext_size; ++r) {
- /* set flag, which represent LYEXT_OPT_VALID */
- if (retval->ext[r]->flags & LYEXT_OPT_VALID) {
+ /* extension instance may not yet be resolved */
+ if (retval->ext[r] && (retval->ext[r]->flags & LYEXT_OPT_VALID)) {
+ /* set flag, which represent LYEXT_OPT_VALID */
retval->flags |= LYS_VALID_EXT;
if (retval->ext[r]->flags & LYEXT_OPT_VALID_SUBTREE) {
retval->flags |= LYS_VALID_EXT_SUBTREE;

View File

@ -1,26 +0,0 @@
From 59a0bff1a5a2f0a0eac07e4bf94d4aea9dd3708d Mon Sep 17 00:00:00 2001
From: Michal Vasko <mvasko@cesnet.cz>
Date: Mon, 8 Mar 2021 09:20:30 +0100
Subject: [PATCH] plugins BUGFIX handle empty revision correctly
Fixes #1451
---
src/plugins.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/plugins.c b/src/plugins.c
index 7e6fdf358..fa62ce76c 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -457,9 +457,8 @@ ext_get_plugin(const char *name, const char *module, const char *revision)
assert(module);
for (u = 0; u < ext_plugins_count; u++) {
- if (!strcmp(name, ext_plugins[u].name) &&
- !strcmp(module, ext_plugins[u].module) &&
- (!ext_plugins[u].revision || !strcmp(revision, ext_plugins[u].revision))) {
+ if (!strcmp(name, ext_plugins[u].name) && !strcmp(module, ext_plugins[u].module) &&
+ ((!revision && !ext_plugins[u].revision) || (revision && !strcmp(revision, ext_plugins[u].revision)))) {
/* we have the match */
return ext_plugins[u].plugin;
}

View File

@ -1,6 +1,7 @@
%global debug_package %{nil}
Name: libyang
Version: 1.0.184
Release: 6
Release: 2
Summary: YANG data modeling language library
Url: https://github.com/CESNET/libyang
Source: %{url}/archive/%{name}-%{version}.tar.gz
@ -9,8 +10,6 @@ License: BSD
Patch0: libyang-1.0.184-doc.patch
Patch1: CVE-2021-28903.patch
Patch2: CVE-2021-28905.patch
Patch3: CVE-2021-28904.patch
Patch4: CVE-2021-28902-CVE-2021-28906.patch
Requires: pcre
BuildRequires: cmake
@ -44,7 +43,7 @@ Summary: Development files for libyang-cpp
Requires: libyang-cpp%{?_isa} = %{version}-%{release}
Requires: pcre-devel
%package -n python3-yang
%package -n python3-libyang
Summary: Python3 bindings for libyang
Requires: libyang-cpp%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-libyang}
@ -55,7 +54,7 @@ Bindings of libyang library to C++ language.
%description -n libyang-cpp-devel
Headers of bindings to c++ language.
%description -n python3-yang
%description -n python3-libyang
Bindings of libyang library to python language.
%description devel
@ -123,28 +122,12 @@ cp -r doc/html %{buildroot}/%{_docdir}/libyang/html
%{_libdir}/pkgconfig/libyang-cpp.pc
%dir %{_includedir}/libyang/
%files -n python3-yang
%files -n python3-libyang
%{python3_sitearch}/yang.py
%{python3_sitearch}/_yang.so
%{python3_sitearch}/__pycache__/yang*
%changelog
* Tue Mar 07 2023 zhouwenpei <zhouwenpei@h-partners.com> - 1.0.184-6
- remove debug_package %{nil} to strip files and provide debug packages
* Sat Dec 24 2022 qisen <qisen@huawei.com> - 1.0.184-5
- addyaml
* Wed Aug 25 2021 orange-snn <songnannan2@huawei.com> - 1.0.184-4
- change the python3 package name to python3-pyang from python3-libyang
* Tue Jun 29 2021 anaonymous_z <zhangrui182@huawei.com> - 1.0.184-3
- Type:CVE
- ID:NA
- SUG:NA
- DESC: fix CVE-2021-28902 CVE-2021-28906
CVE-2021-28904
* Mon Jun 28 2021 zhuqingfu <zhuqingfu1@huawei.com> - 1.0.184-2
- Add patch CVE-2021-28905

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: CESNET/libyang
tag_prefix: ^v
seperator: "."