gbranden pushed a commit to branch master
in repository groff.

commit b88f8d405a0273e54251f3bbe342ec1c8deadbef
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 9 07:04:17 2026 -0600

    [tbl]: Regression-test Savannah #68897.
    
    * src/preproc/tbl/tests/do-not-segv-on-invalid-table-description.sh: New
      file; do it.
    
    * src/preproc/tbl/tbl.am: Update `tbl_TESTS` to run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 +++++
 src/preproc/tbl/tbl.am                             |  1 +
 .../do-not-segv-on-invalid-table-description.sh    | 41 ++++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b36441331..ada61775a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-11-09  G. Branden Robinson <[email protected]>
+
+       [tbl]: Regression-test Savannah #68897.
+
+       * src/preproc/tbl/tests/\
+       do-not-segv-on-invalid-table-description.sh: New file; do it.
+       * src/preproc/tbl/tbl.am: Update `tbl_TESTS` to run test.
+
 2026-11-09  G. Branden Robinson <[email protected]>
 
        * src/preproc/tbl/main.cpp (process format): Recast error
diff --git a/src/preproc/tbl/tbl.am b/src/preproc/tbl/tbl.am
index d5dabc914..43f3e7f86 100644
--- a/src/preproc/tbl/tbl.am
+++ b/src/preproc/tbl/tbl.am
@@ -35,6 +35,7 @@ tbl_TESTS = \
   src/preproc/tbl/tests/count-continued-input-lines.sh \
   src/preproc/tbl/tests/do-not-overdraw-page-top-in-nroff-mode.sh \
   src/preproc/tbl/tests/do-not-overlap-bottom-border-in-nroff.sh \
+  src/preproc/tbl/tests/do-not-segv-on-invalid-table-description.sh \
   src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh \
   src/preproc/tbl/tests/do-not-segv-on-span-only-table-description.sh \
   src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh \
diff --git a/src/preproc/tbl/tests/do-not-segv-on-invalid-table-description.sh 
b/src/preproc/tbl/tests/do-not-segv-on-invalid-table-description.sh
new file mode 100755
index 000000000..1d74dc009
--- /dev/null
+++ b/src/preproc/tbl/tests/do-not-segv-on-invalid-table-description.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+tbl="${abs_top_builddir:-.}/tbl"
+
+# Regression-test Savannah #68897.
+#
+# Don't segfault when a continued table description ends (invalidly)
+# with a row definition comprising only horizontal rule classifiers.
+#
+# Reproducer courtesy of Dickson Wu.
+
+input='.
+.TS
+L.
+.T&
+=.
+.TE
+.'
+
+output=$(printf '%s\n' "$input" | "$tbl")
+printf '%s\n' "$output"
+printf '%s\n' "$output" | grep -Fqx ".TE"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to