[PATCH 0/1] MR10337: msxml: Add support for Unicode escape ranges.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43581 Microsoft Office 2013 installer stops crashing after applying this patch. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337
From: Hieu Le Minh <leminhhieu.opensource@gmail.com> --- libs/xml2/xmlregexp.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/xml2/xmlregexp.c b/libs/xml2/xmlregexp.c index f434a0cf986..a98209c19b9 100644 --- a/libs/xml2/xmlregexp.c +++ b/libs/xml2/xmlregexp.c @@ -4924,6 +4924,13 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { case 'n': start = 0xA; break; case 'r': start = 0xD; break; case 't': start = 0x9; break; + case 'u': + start = parse_escaped_codepoint(ctxt); + if (start < 0) { + ERROR("Invalid codepoint"); + return; + } + break; case '\\': case '|': case '.': case '-': case '^': case '?': case '*': case '+': case '{': case '}': case '(': case ')': case '[': case ']': @@ -4969,6 +4976,13 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { case 'n': end = 0xA; break; case 'r': end = 0xD; break; case 't': end = 0x9; break; + case 'u': + end = parse_escaped_codepoint(ctxt); + if (end < 0) { + ERROR("Invalid codepoint"); + return; + } + break; case '\\': case '|': case '.': case '-': case '^': case '?': case '*': case '+': case '{': case '}': case '(': case ')': case '[': case ']': @@ -5010,7 +5024,7 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { static void xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) { do { - if (CUR == '\\') { + if (CUR == '\\' && NXT(1) != 'u') { xmlFAParseCharClassEsc(ctxt); } else { xmlFAParseCharRange(ctxt); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10337
This was supposed to work already, after some libxml2 changes, mentioned in linked bug report. Is it still not working? This will need a test to show that the fix helps. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337#note_132308
See related libxml2 issue: https://gitlab.gnome.org/GNOME/libxml2/-/issues/1086 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337#note_132632
How is it related to your changes? And what about linked bug report, that was already close as fixed? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337#note_132633
On Wed Mar 18 11:37:01 2026 +0000, Nikolay Sivov wrote:
How is it related to your changes? And what about linked bug report, that was already close as fixed? It seems like the libxml2 regex engine doesn't accept characters in the middle of a range if that range contains unescaped characters such as raw \\n, \\r, \\t, or \\u.
In the linked bug report, only single \\uxxxx parsing was implemented, not \\uxxxx-\\uxxxx ranges within \[\]. Hence, libxml2 still can't compile the regex used by MS Office installer in the bug report. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337#note_132634
On Wed Mar 18 11:37:01 2026 +0000, Hieu Le Minh wrote:
It seems like the libxml2 regex engine doesn't accept characters in the middle of a range if that range contains unescaped characters such as raw \\n, \\r, \\t, or \\u. In the linked bug report, only single \\uxxxx parsing was implemented, not \\uxxxx-\\uxxxx ranges within \[\]. Hence, libxml2 still can't compile the regex used by MS Office installer in the bug report. In this case it needs a wine test. Then libxml2 change in wine tree only makes sense if this fix is not accepted in upstream libxml2.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337#note_132635
This merge request was closed by Hieu Le Minh. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10337
participants (3)
-
Hieu Le Minh -
Hieu Le Minh (@hieu1m) -
Nikolay Sivov (@nsivov)