texlive[62341] Build/source/texk/web2c/hitexdir/hitex.w: HiTeX:

commits+mruckert at tug.org commits+mruckert at tug.org
Wed Mar 2 18:46:32 CET 2022


Revision: 62341
          http://tug.org/svn/texlive?view=revision&revision=62341
Author:   mruckert
Date:     2022-03-02 18:46:32 +0100 (Wed, 02 Mar 2022)
Log Message:
-----------
HiTeX: fixing a possible segmentation fault in case of empty output

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/hitexdir/hitex.w

Modified: trunk/Build/source/texk/web2c/hitexdir/hitex.w
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hitex.w	2022-03-02 14:19:25 UTC (rev 62340)
+++ trunk/Build/source/texk/web2c/hitexdir/hitex.w	2022-03-02 17:46:32 UTC (rev 62341)
@@ -21150,13 +21150,16 @@
 {@+
 if (privileged())
   {@+if ((page_head==page_tail)&&(dead_cycles==0))
-    {@+pointer p=head;
-       if (option_no_empty_page)
-         while (p!=tail)
+    {
+       if (head==tail) return true;
+       else if (option_no_empty_page)
+       { pointer p=link(head);
+         while (p!=null)
          { if (is_visible(p)) break;
            else p=link(p);
          }
-       if (p==tail) return true;
+         if (p==null) return true;
+       }
     }
   back_input(); /*we will try to end again after ejecting residual material*/
   tail_append(new_set_node());
@@ -30791,7 +30794,7 @@
   do
   { pointer p= link(contrib_head);
     pointer q=null; /* for output nodes */
-    pointer *t; /*the tail of the output nodes*/
+    pointer *t=NULL; /*the tail of the output nodes*/
     bool eject=(type(p)==penalty_node && penalty(p)<=eject_penalty);
     @<Record the bottom mark@>@;
     @<Suppress empty pages if requested@>@;
@@ -30860,6 +30863,11 @@
 another eject penalty comes along. To override the delayed output,
 a penalty less or equal to a double |eject_penalty| can be used.
 The function |its_all_over| is an example for such a use.
+It seems that the eliminated nodes do not contain anything of value
+for the output routine, but the output routine might have other
+resources, like the first column of a two column page, which it might
+put back on the contribution list. So it is wise to call the output routine
+and give it a chance.
 
 @<Suppress empty pages if requested@>=
 if (option_no_empty_page &&
@@ -31049,7 +31057,7 @@
 @ @<Fire up the output routine for |q|@>=
 { pointer r=new_null_box();type(r)=vlist_node;
   subtype(r)=0;shift_amount(r)=0;height(r)=hvsize;
-  if (t==NULL) list_ptr(r)=new_glue(ss_glue);
+  if (t==NULL) list_ptr(r)=null;
   else { list_ptr(r)=q;  *t=new_glue(ss_glue); }
   flush_node_list(box(255)); /* just in case \dots */
   box(255)=r;



More information about the tex-live-commits mailing list.