gbranden pushed a commit to branch master
in repository groff.

commit 8ff0f229cbb6f580ae003a49a82f8c9018d1b9e5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 17 20:34:35 2024 -0500

    [me]: Use `\n[.R]` instead of "10000".
    
    * tmac/e.tmac (@M, $c): If the formatter is GNU troff, use value of its
      `.R` register instead of "10000" to indicate an arbitrary large
      integer.
    
      (EQ): Same, but in commented form; a formatter DoS attack is otherwise
      revealed.
    
      (TS): Similar; set line length to `.R` basic units minus 1n to avoid
      saturation warnings on output devices with a non-unit horizontal
      motion quantum.
---
 ChangeLog   | 11 +++++++++++
 tmac/e.tmac | 15 +++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8be28e9ee..c6fbcec6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-17  G. Branden Robinson <[email protected]>
+
+       * tmac/e.tmac (@M, $c): If the formatter is GNU troff,
+       use value of its `.R` register instead of "10000" to indicate an
+       arbitrary large integer.
+       (EQ): Same, but in commented form; a formatter DoS attack is
+       otherwise revealed.
+       (TS): Similar; set line length to `.R` basic units minus 1n to
+       avoid saturation warnings on output devices with a non-unit
+       horizontal motion quantum.
+
 2024-08-17  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (init_input_requests): Initialize
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 7f55c0be3..7e04cb202 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1131,7 +1131,11 @@
 .      xl -\\n(biu
 .\}
 .if \\n(_d=1 \
-.      ce 10000
+\{\
+.      ie \n(.g .ce \n(.R
+.      el       .ce 10000
+.\}
+.
 ..
 .
 .de @)                 \" --- end keep
@@ -1239,7 +1243,8 @@
 .if "\*(.T"html" \
 \{\
 .      do nr e-EQ-ll \\n(.l
-.      ll 1000n
+.      ie \n(.g .ll 1000n \" XXX: \\n(.Ru-1n DoSes troff
+.      el       .ll 1000n
 .\}
 .do HTML-IMAGE
 .if !\\n(?e \
@@ -1318,7 +1323,8 @@
 .if "\*(.T"html" \
 \{\
 .      do nr e-TS-ll \\n(.l
-.      ll 1000n
+.      ie \n(.g .ll \\n(.Ru-1n
+.      el       .ll 1000n
 .\}
 .do HTML-IMAGE
 .@C 1
@@ -1968,7 +1974,8 @@
 .de $c                 \" $$$ print chapter title
 .sz 12
 .ft 3
-.ce 1000
+.ie \n(.g .ce \n(.R
+.el       .ce 10000
 .if \\n(_M<3 \
 .      nr ch +1
 .ie \\n(_M=1 \\*(wc\~\\n(ch

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

Reply via email to