diff --git a/fix-memleak-in-GetTokenFromStream.patch b/fix-memleak-in-GetTokenFromStream.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0bbef0effdc7b6fee0f0a9d166b1590e7b6557a --- /dev/null +++ b/fix-memleak-in-GetTokenFromStream.patch @@ -0,0 +1,40 @@ +From 4377ab84a4a2748d72be91d26210567cc933c760 Mon Sep 17 00:00:00 2001 +From: lutianxiong +Date: Sat, 20 Jun 2020 09:19:17 +0800 +Subject: [PATCH 095/109] fix memleak in GetTokenFromStream + +check asp & php if ParseAttribute return NULL +--- + src/lexer.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/src/lexer.c b/src/lexer.c +index ca66aee..bbc1e15 100644 +--- a/src/lexer.c ++++ b/src/lexer.c +@@ -3263,6 +3263,22 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode ) + + if (!name) + { ++ /* check if attributes are created by ASP markup */ ++ if (asp) ++ { ++ av = TY_(NewAttribute)(doc); ++ av->asp = asp; ++ AddAttrToList( &attributes, av ); ++ } ++ ++ /* check if attributes are created by PHP markup */ ++ if (php) ++ { ++ av = TY_(NewAttribute)(doc); ++ av->php = php; ++ AddAttrToList( &attributes, av ); ++ } ++ + /* fix for http://tidy.sf.net/bug/788031 */ + lexer->lexsize -= 1; + lexer->txtend = lexer->txtstart; +-- +1.8.3.1 + diff --git a/tidy.spec b/tidy.spec index bb8c04b649cf370c794cef0754993fca1016a2f7..acee7bd7cf67ca46a0598ee5fb910260cc6e1dd0 100644 --- a/tidy.spec +++ b/tidy.spec @@ -3,13 +3,14 @@ Name: tidy Version: 5.6.0 -Release: 2 +Release: 3 Summary: Utility to clean up and pretty print HTML/XHTML/XML License: W3C URL: http://www.html-tidy.org/ Source0: https://github.com/htacg/%{upname}/archive/%{version}.tar.gz#/%{upname}-%{version}.tar.gz Patch0001: 0002-Issue-656-protect-against-NULL-node-set-in-loop.patch +Patch0002: fix-memleak-in-GetTokenFromStream.patch BuildRequires: gcc-c++ cmake gcc libxslt pkgconfig Provides: tidy-html5 = %{version}-%{release} @@ -80,6 +81,12 @@ ln -s tidyplatform.h $RPM_BUILD_ROOT%{_includedir}/platform.h %{_mandir}/* %changelog +* Fri Nov 20 2020 lunankun - 5.6.0-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix memleak + * Wed Sep 02 2020 gaihuiying - 5.6.0-2 - Type:bugfix - DESC:change Source0 to correct URL