Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
42e636ad3f
!26 [sync] PR-24: 修复tinyxml-devel包无法使用的问题
From: @openeuler-sync-bot 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
2023-05-03 05:42:39 +00:00
will_niutao
f0381d9eb3 fix: change tinyxml.h to use STL to fix the devel package error
Signed-off-by: will_niutao <niutao2@huawei.com>
(cherry picked from commit 01edb4fe3036c9318454d94dbea60fd85840cacb)
2023-05-03 13:29:25 +08:00
openeuler-ci-bot
3704470648
!23 [sync] PR-5: Change the patch name to CVE-2021-42260.patch
Merge pull request !23 from openeuler-sync-bot/sync-pr5-master-to-openEuler-22.03-LTS-Next
2022-01-29 07:16:57 +00:00
starlet-dx
e9a033ce5f Change the patch name to CVE-2021-42260.patch
(cherry picked from commit e41b7ed3163b55acd51ee7c12d606928dafe6962)
2022-01-29 14:26:10 +08:00
openeuler-ci-bot
f247be081c
!17 [sync] PR-3: Fix CVE-2021-42260
Merge pull request !17 from openeuler-sync-bot/sync-pr3-master-to-openEuler-22.03-LTS-Next
2022-01-29 03:53:10 +00:00
Zhiyi Weng
fb5ff55a67 Fix CVE-2021-42260
(cherry picked from commit 9b314d6163e5448789190a2576df0daf87e5a0c3)
2022-01-29 09:05:21 +08:00
openeuler-ci-bot
a12a89dc66
!11 [sync] PR-2: change the spec file name to be the same as the repo name
Merge pull request !11 from openeuler-sync-bot/sync-pr2-master-to-openEuler-22.03-LTS-Next
2022-01-28 12:26:25 +00:00
chen-jan
5b7a71bf86 change the spec file name to be the same as the repo name
(cherry picked from commit 1bd4dadec89d77013be0d0ffb20fa309f6df5114)
2022-01-27 17:44:01 +08:00
openeuler-ci-bot
55961dd538 !1 package init
Merge pull request !1 from small_leek/xsl
2020-02-29 14:38:29 +08:00
small_leek
a5927389d9 package init 2020-02-29 01:27:43 -05:00
4 changed files with 127 additions and 0 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

81
tinyxml.spec Normal file
View File

@ -0,0 +1,81 @@
Name: tinyxml
Version: 2.6.2
Release: 23
Summary: C++ XML parser
License: zlib
URL: http://www.grinninglizard.com/tinyxml/
Source0: http://downloads.sourceforge.net/tinyxml/tinyxml_2_6_2.tar.gz
Patch0001: CVE-2021-42260.patch
Patch0002: 2-fix-devel-package-error.patch
BuildRequires: gcc-c++
%description
TinyXML parses an XML document, and builds from that a Document
Object Model (DOM) that can be read, modified, and saved.
XML is a very structured and convenient format. All those random file
formats created to store application data can all be replaced with XML.
One parser for everything.
%package devel
Summary: Development files for tinyxml
Requires: %{name} = %{version}-%{release}
%description devel
The devel package contains development files for tinyxml.
It provides header files and libraries for tinyxml.
%prep
%autosetup -p1 -n tinyxml
touch tinyxml.h
%build
g++ $RPM_OPT_FLAGS -fPIC -o tinyxml.cpp.o -c tinyxml.cpp
g++ $RPM_OPT_FLAGS -fPIC -o tinystr.cpp.o -c tinystr.cpp
g++ $RPM_OPT_FLAGS -fPIC -o tinyxmlerror.cpp.o -c tinyxmlerror.cpp
g++ $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
%install
install -d $RPM_BUILD_ROOT%{_libdir}
cp lib%{name}.so.0.%{version} $RPM_BUILD_ROOT%{_libdir}/
chmod 755 $RPM_BUILD_ROOT%{_libdir}/libtinyxml.so.0.%{version}
ln -s libtinyxml.so.0.%{version} $RPM_BUILD_ROOT%{_libdir}/libtinyxml.so
ln -s libtinyxml.so.0.%{version} $RPM_BUILD_ROOT%{_libdir}/libtinyxml.so.0
install -d $RPM_BUILD_ROOT%{_includedir}
cp tinyxml.h $RPM_BUILD_ROOT%{_includedir}/
chmod 644 $RPM_BUILD_ROOT%{_includedir}/tinyxml.h
mkdir -p %{buildroot}%{_libdir}/pkgconfig
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%doc changes.txt readme.txt
%{_libdir}/*.so.*
%files devel
%doc docs/*
%{_includedir}/*
%{_libdir}/*.so
%changelog
* 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
- change the spec file name to be the same as the repo name
* Tue Feb 18 2020 Senlin Xia <xiasenlin1@huawei.com> - 2.6.2-19
- Package init

BIN
tinyxml_2_6_2.tar.gz Normal file

Binary file not shown.