Compare commits
10 Commits
fa3c209b91
...
42e636ad3f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42e636ad3f | ||
|
|
f0381d9eb3 | ||
|
|
3704470648 | ||
|
|
e9a033ce5f | ||
|
|
f247be081c | ||
|
|
fb5ff55a67 | ||
|
|
a12a89dc66 | ||
|
|
5b7a71bf86 | ||
|
|
55961dd538 | ||
|
|
a5927389d9 |
14
2-fix-devel-package-error.patch
Normal file
14
2-fix-devel-package-error.patch
Normal 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
32
CVE-2021-42260.patch
Normal 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
81
tinyxml.spec
Normal 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
BIN
tinyxml_2_6_2.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user