groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/08: Revert "[troff]: Add sanity check to prevent SEGV."


From: G. Branden Robinson
Subject: [groff] 01/08: Revert "[troff]: Add sanity check to prevent SEGV."
Date: Fri, 30 Jul 2021 01:25:01 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit bfcfdc670ac7d964dce5d846b9367a998d0f7e46
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jul 30 12:12:17 2021 +1000

    Revert "[troff]: Add sanity check to prevent SEGV."
    
    This reverts commit 01a65469b56f7284041365b0b179b6b4b9153b9c.
    
    The image file name string can indeed validly be a null pointer; this
    can happen with the \O2 escape as used by pdfmark to write bounding box
    information with no associated image.
    
    Tadziu Hoffman explains[1]:
    
        pdfmark uses the suppression mechanism bounding box output to
        find the anchor positions, but no images are involved.  The
        Postscript branch in suppress_node::tprint should be perfectly
        okay with an empty image_filename.  [In the change being
        reverted], the entire "is_html / else postscript (or other
        device)" switch is being skipped if we have no image_filename,
        resulting in no output of the link anchor information for
        pdfmark.
    
    [1] https://lists.gnu.org/archive/html/groff/2021-07/msg00123.html
---
 ChangeLog               | 19 -------------------
 src/roff/troff/node.cpp |  5 -----
 2 files changed, 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6c34cd9..113cbb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,24 +1,5 @@
 2021-07-29  G. Branden Robinson <g.branden.robinson@gmail.com>
 
-       [troff]: Add sanity check to prevent SEGV.
-
-       * src/roff/troff/node.cpp (suppress_node::tprint): If emitting
-       bounding box limits for an image filename, ensure that
-       `image_filename` is not a null pointer (and furthermore that
-       it's not a zero-length string even if the pointer is valid).
-       Emit an error diagnostic and skip further processing of the node
-       if they are if they are.  This problem implies nonsensical input
-       {so we should guard against it}, but I cannot reproduce the
-       problem _except_ with pdfroff during a build of the groff tree,
-       which has been reliably failing to relocate the table of
-       contents in pdfmark.pdf since commit
-       e876d4bfd193abb9a7d1fb6e76519349bded482a, 27 July.  If I extract
-       the groff and troff commands that pdfroff is running and execute
-       them in the build directory, they complete successfully, which
-       suggests to me an environment problems or a race condition.
-
-2021-07-29  G. Branden Robinson <g.branden.robinson@gmail.com>
-
        [troff]: Refactor some internal functions.
 
        * src/roff/troff/node.cpp: Rename two functions that have only
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index c93d8bc..fdb52c7 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -4090,10 +4090,6 @@ void suppress_node::tprint(troff_output_file *out)
   else {
     // Now check whether the suppress node requires us to issue limits.
     if (emit_limits) {
-      if ((0 == image_filename) || (strlen(image_filename) == 0))
-       error("cannot emit suppresion node placement information"
-             " without a (saved) filename; skipping");
-      else {
       const size_t namebuflen = 8192;
       char name[namebuflen] = { '\0' };
       // Jump through a flaming hoop to avoid a "format nonliteral"
@@ -4194,7 +4190,6 @@ void suppress_node::tprint(troff_output_file *out)
                name, hresolution, vresolution, get_string(".F"));
        fflush(stderr);
       }
-      }
     }
     else {
       if (is_on) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]