Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
280bd3d8e8
!41 [sync] PR-36: Use __cxx marco to support Clang
From: @openeuler-sync-bot 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
2025-01-13 02:41:45 +00:00
Suyun
59e5de5e92 Use __cxx marco to support Clang
(cherry picked from commit cfeb02849ce319f3fca14699798ac05278484077)
2025-01-13 10:17:08 +08:00
openeuler-ci-bot
34867cd1ea
!31 [sync] PR-27: fix CVE-2023-34194
From: @openeuler-sync-bot 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
2024-12-24 05:49:50 +00:00
Jianmin
eab8578060 fix CVE-2023-34194
(cherry picked from commit f9f087fea40f146a0d5b23f2ad63a30eb5848443)
2024-12-24 11:04:46 +08:00
openeuler-ci-bot
5b0746bade
!24 修复tinyxml-devel包无法使用的问题
From: @will_niutao 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
2023-05-03 05:29:18 +00:00
will_niutao
01edb4fe30 fix: change tinyxml.h to use STL to fix the devel package error
Signed-off-by: will_niutao <niutao2@huawei.com>
2023-04-28 10:36:56 +08:00
openeuler-ci-bot
dff8d06706
!5 Change the patch name to CVE-2021-42260.patch
Merge pull request !5 from starlet_dx/master
2022-01-27 09:06:43 +00:00
starlet-dx
e41b7ed316 Change the patch name to CVE-2021-42260.patch 2022-01-27 15:17:48 +08:00
openeuler-ci-bot
2f343f5b18 !3 Fix CVE-2021-42260
From: @vyloy
Reviewed-by: @jianminw
Signed-off-by: @jianminw
2021-11-11 01:43:46 +00:00
Zhiyi Weng
9b314d6163 Fix CVE-2021-42260 2021-11-10 19:55:44 +08:00
4 changed files with 99 additions and 7 deletions

View File

@ -0,0 +1,14 @@
diff -Naur tinyxml/tinyxml.h tinyxml_new/tinyxml.h
--- tinyxml/tinyxml.h 2011-05-15 10:24:57.000000000 +0800
+++ tinyxml_new/tinyxml.h 2023-04-27 20:10:36.533804686 +0800
@@ -26,6 +26,10 @@
#ifndef TINYXML_INCLUDED
#define TINYXML_INCLUDED
+#ifndef TIXML_USE_STL
+#define TIXML_USE_STL
+#endif
+
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4530 )

32
CVE-2021-42260.patch Normal file
View File

@ -0,0 +1,32 @@
From f7ca0035d17a663f55668e662b840afce7b86112 Mon Sep 17 00:00:00 2001
From: Christian Voegl <cvoegl@suse.com>
Date: Wed, 27 Oct 2021 11:25:18 +0200
Subject: [PATCH] In stamp always advance the pointer if *p= 0xef
The current implementation only advanced if 0xef is followed
by two non-zero bytes. In case of malformed input (0xef should be
the start byte of a three byte character) this leads to an infinite
loop. (CVE-2021-42260)
---
tinyxmlparser.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tinyxmlparser.cpp b/tinyxmlparser.cpp
index 81b7eae..8aa0dfa 100755
--- a/tinyxmlparser.cpp
+++ b/tinyxmlparser.cpp
@@ -274,6 +274,12 @@ void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding )
else
{ p +=3; ++col; } // A normal character.
}
+ else
+ {
+ // TIXML_UTF_LEAD_0 (239) is the start character of a 3 byte sequence, so
+ // there is something wrong here. Just advance the pointer to evade infinite loops
+ ++p;
+ }
}
else
{
--
2.33.0

28
CVE-2023-34194.patch Normal file
View File

@ -0,0 +1,28 @@
From: Guilhem Moulin <guilhem@debian.org>
Date: Sat, 30 Dec 2023 14:15:54 +0100
Subject: Avoid reachable assertion via crafted XML document with a '\0'
located after whitespace
Bug: https://www.forescout.com/resources/sierra21-vulnerabilities
Bug-Debian: https://bugs.debian.org/1059315
Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2023-34194
Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2023-40462
---
tinyxmlparser.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tinyxmlparser.cpp b/tinyxmlparser.cpp
index 8aa0dfa..1601962 100644
--- a/tinyxmlparser.cpp
+++ b/tinyxmlparser.cpp
@@ -1606,6 +1606,10 @@ const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXm
}
p = SkipWhiteSpace( p, _encoding );
+ if ( !p || !*p )
+ {
+ break;
+ }
if ( StringEqual( p, "version", true, _encoding ) )
{
TiXmlAttribute attrib;

View File

@ -1,10 +1,13 @@
Name: tinyxml Name: tinyxml
Version: 2.6.2 Version: 2.6.2
Release: 20 Release: 25
Summary: C++ XML parser Summary: C++ XML parser
License: zlib License: zlib
URL: http://www.grinninglizard.com/tinyxml/ URL: http://www.grinninglizard.com/tinyxml/
Source0: http://downloads.sourceforge.net/tinyxml/tinyxml_2_6_2.tar.gz Source0: http://downloads.sourceforge.net/tinyxml/tinyxml_2_6_2.tar.gz
Patch0001: CVE-2021-42260.patch
Patch0002: 2-fix-devel-package-error.patch
Patch0003: CVE-2023-34194.patch
BuildRequires: gcc-c++ BuildRequires: gcc-c++
%description %description
@ -23,15 +26,15 @@ The devel package contains development files for tinyxml.
It provides header files and libraries for tinyxml. It provides header files and libraries for tinyxml.
%prep %prep
%autosetup -n tinyxml %autosetup -p1 -n tinyxml
touch tinyxml.h touch tinyxml.h
%build %build
g++ $RPM_OPT_FLAGS -fPIC -o tinyxml.cpp.o -c tinyxml.cpp %{__cxx} $RPM_OPT_FLAGS -fPIC -o tinyxml.cpp.o -c tinyxml.cpp
g++ $RPM_OPT_FLAGS -fPIC -o tinystr.cpp.o -c tinystr.cpp %{__cxx} $RPM_OPT_FLAGS -fPIC -o tinystr.cpp.o -c tinystr.cpp
g++ $RPM_OPT_FLAGS -fPIC -o tinyxmlerror.cpp.o -c tinyxmlerror.cpp %{__cxx} $RPM_OPT_FLAGS -fPIC -o tinyxmlerror.cpp.o -c tinyxmlerror.cpp
g++ $RPM_OPT_FLAGS -fPIC -o tinyxmlparser.cpp.o -c tinyxmlparser.cpp %{__cxx} $RPM_OPT_FLAGS -fPIC -o tinyxmlparser.cpp.o -c tinyxmlparser.cpp
g++ $RPM_LD_FLAGS -shared -o libtinyxml.so.0.%{version} -Wl,-soname,libtinyxml.so.0 *.cpp.o %{__cxx} $RPM_LD_FLAGS -shared -o libtinyxml.so.0.%{version} -Wl,-soname,libtinyxml.so.0 *.cpp.o
%install %install
@ -63,6 +66,21 @@ mkdir -p %{buildroot}%{_libdir}/pkgconfig
%{_libdir}/*.so %{_libdir}/*.so
%changelog %changelog
* Wed Jan 08 2025 Suyun <ziyu.oerv@isrc.iscas.ac.cn> - 2.6.2-25
- Use __cxx marco to support Clang
* Tue Dec 24 2024 Jianmin <jianmin@iscas.ac.cn> - 2.6.2-24
- fix CVE-2023-34194
* Fri Apr 28 2023 will_niutao <huawei2@huawei.com> - 2.6.2-23
- fix the devel package error
* Thu Jan 27 2022 yaoxin <yaoxin30@huawei.com> - 2.6.2-22
- Change the patch name to CVE-2021-42260.patch.
* Mon Nov 1 2021 Zhiyi Weng <zhiyi@iscas.ac.cn> - 2.6.2-21
- Fix CVE-2021-42260
* Tue Oct 26 2021 chenchen <chen_aka_jan@163.com> - 2.6.2-20 * Tue Oct 26 2021 chenchen <chen_aka_jan@163.com> - 2.6.2-20
- change the spec file name to be the same as the repo name - change the spec file name to be the same as the repo name