Package: w3-dtd-mathml
Version: 2.0.0.0-5.1
Severity: grave
Tags: patch
Justification: renders package unusable

The incorrect amp and lt entity redefinition yields failures with
libxml2 2.9.12, which is now in Debian. This introduces a major
regression.

Here's a testcase for one of the buggy files.

$ cat test.xml
<?xml version="1.0"?>
<!DOCTYPE root [
<!ENTITY % ent-isonum
      PUBLIC "-//W3C//ENTITIES Numeric and Special Graphic for MathML 2.0//EN"
             "http://www.w3.org/TR/MathML2/dtd/isonum.ent";>
%ent-isonum;
]>
<root/>

$ xmllint --nonet --noout --noent test.xml
error : xmlAddEntity: invalid redeclaration of predefined entity
error : xmlAddEntity: invalid redeclaration of predefined entity

The attached patch fixes this bug.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993638 about a
similar problem in the old w3c-dtd-xhtml package (no longer in Debian)
and the behavior of libxml2 2.9.12.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages w3-dtd-mathml depends on:
ii  sgml-base  1.30
ii  xml-core   0.18+nmu1

w3-dtd-mathml recommends no packages.

Versions of packages w3-dtd-mathml suggests:
ii  docbook-mathml  1.1CR1-2.1

-- no debconf information

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Description: Fix redeclaration of predefined entities amp and lt.
 The redeclaration of these entities is invalid and libxml2 2.9.12
 checks that a redeclaration is equivalent to the predefined one.
 See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993638 about
 the same issue in w3c-dtd-xhtml and a long discussion.
Author: Vincent Lefevre <vinc...@vinc17.net>
Last-Update: 2021-09-21

Index: b/isonum.ent
===================================================================
--- a/isonum.ent
+++ b/isonum.ent
@@ -25,7 +25,7 @@
 
 -->
 
-<!ENTITY amp              "&#x26;&#x00026;" ><!--=ampersand -->
+<!ENTITY amp              "&#38;#38;" ><!--=ampersand -->
 <!ENTITY apos             "&#x00027;" ><!--=apostrophe -->
 <!ENTITY ast              "&#x0002A;" ><!--/ast B: =asterisk -->
 <!ENTITY brvbar           "&#x000A6;" ><!--=broken (vertical) bar -->
@@ -63,7 +63,7 @@
 <!ENTITY lpar             "&#x00028;" ><!--O: =left parenthesis -->
 <!ENTITY lsqb             "&#x0005B;" ><!--/lbrack O: =left square bracket -->
 <!ENTITY lsquo            "&#x02018;" ><!--=single quotation mark, left -->
-<!ENTITY lt               "&#x26;&#x0003C;" ><!--=less-than sign R: -->
+<!ENTITY lt               "&#38;#60;" ><!--=less-than sign R: -->
 <!ENTITY micro            "&#x000B5;" ><!--=micro sign -->
 <!ENTITY middot           "&#x000B7;" ><!--/centerdot B: =middle dot -->
 <!ENTITY nbsp             "&#x000A0;" ><!--=no break (required) space -->
Index: b/xhtml-math11-f.dtd
===================================================================
--- a/xhtml-math11-f.dtd
+++ b/xhtml-math11-f.dtd
@@ -1874,8 +1874,8 @@
 
 <!-- C0 Controls and Basic Latin -->
 <!ENTITY quot    "&#34;" ><!-- quotation mark = APL quote, U+0022 ISOnum -->
-<!ENTITY amp     "&#38;" ><!-- ampersand, U+0026 ISOnum -->
-<!ENTITY lt      "&#60;" ><!-- less-than sign, U+003C ISOnum -->
+<!ENTITY amp     "&#38;#38;" ><!-- ampersand, U+0026 ISOnum -->
+<!ENTITY lt      "&#38;#60;" ><!-- less-than sign, U+003C ISOnum -->
 <!ENTITY gt      "&#62;" ><!-- greater-than sign, U+003E ISOnum -->
 
 <!-- Latin Extended-A -->
@@ -8393,7 +8393,7 @@
 
 -->
 
-<!ENTITY amp              "&#x26;&#x00026;" ><!--=ampersand -->
+<!ENTITY amp              "&#38;#38;" ><!--=ampersand -->
 <!ENTITY apos             "&#x00027;" ><!--=apostrophe -->
 <!ENTITY ast              "&#x0002A;" ><!--/ast B: =asterisk -->
 <!ENTITY brvbar           "&#x000A6;" ><!--=broken (vertical) bar -->
@@ -8431,7 +8431,7 @@
 <!ENTITY lpar             "&#x00028;" ><!--O: =left parenthesis -->
 <!ENTITY lsqb             "&#x0005B;" ><!--/lbrack O: =left square bracket -->
 <!ENTITY lsquo            "&#x02018;" ><!--=single quotation mark, left -->
-<!ENTITY lt               "&#x26;&#x0003C;" ><!--=less-than sign R: -->
+<!ENTITY lt               "&#38;#60;" ><!--=less-than sign R: -->
 <!ENTITY micro            "&#x000B5;" ><!--=micro sign -->
 <!ENTITY middot           "&#x000B7;" ><!--/centerdot B: =middle dot -->
 <!ENTITY nbsp             "&#x000A0;" ><!--=no break (required) space -->

Reply via email to