Damjan Jovanovic : msxml3: Use XSD regex quantifier format S{0, m} instead of S{, m}.

Alexandre Julliard julliard at winehq.org
Thu Aug 12 16:35:19 CDT 2021


Module: wine
Branch: master
Commit: 53f3cad7fbb19b489419afae4e1e73486384f98d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=53f3cad7fbb19b489419afae4e1e73486384f98d

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Wed Aug 11 07:16:53 2021 +0200

msxml3: Use XSD regex quantifier format S{0, m} instead of S{, m}.

S{,m} is invalid in libxml2 2.9.11 and later, and was never valid
in the XSD specification or any XML implementation tested. We
should only use S{0,m} for our internal XSD schema used in XDR validation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51358
Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msxml3/datatypes.xsd  | 4 ++--
 dlls/msxml3/tests/schema.c | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/msxml3/datatypes.xsd b/dlls/msxml3/datatypes.xsd
index 9e0479d8ca2..ffbe0e2f858 100644
--- a/dlls/msxml3/datatypes.xsd
+++ b/dlls/msxml3/datatypes.xsd
@@ -200,7 +200,7 @@
         </xsd:annotation>
 
         <xsd:restriction base="xsd:decimal">
-            <xsd:pattern value="([0-9]{,14})([.][0-9]{,4})?"/>
+            <xsd:pattern value="([0-9]{0,14})([.][0-9]{0,4})?"/>
         </xsd:restriction>
     </xsd:simpleType>
 
@@ -539,7 +539,7 @@
         </xsd:annotation>
 
         <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9A-Fa-f]{4})([-]{,1}[0-9A-Fa-f]{4})*"/>
+            <xsd:pattern value="([0-9A-Fa-f]{4})([-]{0,1}[0-9A-Fa-f]{4})*"/>
         </xsd:restriction>
     </xsd:simpleType>
 
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index b66be76c159..8dc9dcd7e22 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -1115,7 +1115,9 @@ static void test_regex(void)
         { L"\\~", L"~", TRUE },
         { L"\\uCAFE", L"\xCAFE", TRUE },
         /* non-BMP character in surrogate pairs: */
-        { L"\\uD83D\\uDE00", L"\xD83D\xDE00", TRUE }
+        { L"\\uD83D\\uDE00", L"\xD83D\xDE00", TRUE },
+        /* "x{,2}" is non-standard and only works on libxml2 <= v2.9.10 */
+        { L"x{0,2}", L"x", FALSE }
     };
 
     int i;




More information about the wine-cvs mailing list