texlive[50231] Build/source/texk/bibtex-x: avoid access violation

commits+kakuto at tug.org commits+kakuto at tug.org
Tue Mar 5 02:00:10 CET 2019


Revision: 50231
          http://tug.org/svn/texlive?view=revision&revision=50231
Author:   kakuto
Date:     2019-03-05 02:00:09 +0100 (Tue, 05 Mar 2019)
Log Message:
-----------
avoid access violation

Modified Paths:
--------------
    trunk/Build/source/texk/bibtex-x/ChangeLog
    trunk/Build/source/texk/bibtex-x/bibtex-2.c

Modified: trunk/Build/source/texk/bibtex-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/bibtex-x/ChangeLog	2019-03-04 22:24:34 UTC (rev 50230)
+++ trunk/Build/source/texk/bibtex-x/ChangeLog	2019-03-05 01:00:09 UTC (rev 50231)
@@ -1,3 +1,7 @@
+2019-03-05  Akira Kakuto  <kakuto at w32tex.org>
+
+	* bibtex-2.c: Avoid access violation on Windows.
+
 2019-03-04  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	Both BibTeX8 and BibTeXu:

Modified: trunk/Build/source/texk/bibtex-x/bibtex-2.c
===================================================================
--- trunk/Build/source/texk/bibtex-x/bibtex-2.c	2019-03-04 22:24:34 UTC (rev 50230)
+++ trunk/Build/source/texk/bibtex-x/bibtex-2.c	2019-03-05 01:00:09 UTC (rev 50231)
@@ -2969,6 +2969,21 @@
   u_strFromUTF8(uch1, ucap, &uchlen1, (char *)&ENTRY_STRS(ptr1, 0), lenk1, &err1);
   u_strFromUTF8(uch2, ucap, &uchlen2, (char *)&ENTRY_STRS(ptr2, 0), lenk2, &err1);
 
+/*
+   In my Windows build, the above fails: err1 != U_ZERO_ERROR, which
+   gives access violation in ucol_open(). Maybe my ICU build is wrong.
+   In this case I use the original functions which seem not working,
+   only to avoid a crash by access violation. Thus I cannot support
+   correct behavior for bibtexu on Windows.  -- A. Kakuto 2019/03/05
+*/
+
+  if (!U_SUCCESS(err1)) {
+    uchlen1 = icu_toUChars(entry_strs, (ptr1 * (ENT_STR_SIZE+1)), lenk1, uch1, ucap);
+    uchlen2 = icu_toUChars(entry_strs, (ptr2 * (ENT_STR_SIZE+1)), lenk2, uch2, ucap);
+  }
+
+  err1 = U_ZERO_ERROR;
+
   if(Flag_location)
     ucol1 = ucol_open(Str_location, &err1);
   else



More information about the tex-live-commits mailing list