groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: [ms]: Defend against uncontrolled page trap recursion.


From: Keith Marshall
Subject: [groff] 01/01: [ms]: Defend against uncontrolled page trap recursion.
Date: Sat, 23 Oct 2021 16:57:16 -0400 (EDT)

keithmarshall pushed a commit to branch master
in repository groff.

commit 8830820a9a85ad52a8452017d52e67378a76c4c4
Author: Keith Marshall <keith.d.marshall@ntlworld.com>
AuthorDate: Sat Oct 23 21:56:31 2021 +0100

    [ms]: Defend against uncontrolled page trap recursion.
    
    * tmac/s.tmac (pg@top) [HM+FM+.V>.p]: Diagnose insufficient page
    length, and abort; cf. <https://savannah.gnu.org/bugs/?61294>
---
 ChangeLog   |  7 +++++++
 tmac/s.tmac | 11 ++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a3a3f54..0de438e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-10-23  Keith Marshall  <keith.d.marshall@ntlworld.com>
+
+       [ms]: Defend against uncontrolled page trap recursion.
+
+       * tmac/s.tmac (pg@top) [HM+FM+.V>.p]: Diagnose insufficient page
+       length, and abort; cf. <https://savannah.gnu.org/bugs/?61294>
+
 2021-10-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/tmac.am: Build more quietly.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 186951f..735e50e 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -566,8 +566,17 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .de 1C
 .MC \\n[LL]u
 ..
-.\" top of page macro
 .de pg@top
+.\" Invoked by '.wh 0' trap at the top of every page.
+.\" At short page length, recursion may occur; ensure
+.\" that page length is sufficient to avoid it.
+.if (u;\\n[HM]+\\n[FM])+\n[.V]>\\n[.p]) \{\
+.      ds pg*pl-abort-msg] "\*[@s]:\"
+.      if !'\\n[.F]'' .as pg*pl-abort-msg "\\n[.F]:\"
+.      if !'\\n[.c]'0' .as pg*pl-abort-msg "\\n[.c]:\"
+.      as pg*pl-abort-msg " abort: insufficient page length specified\"
+.      ab \\*[pg*pl-abort-msg]
+.   \}
 .ch pg*footer -\\n[FM]u/2u
 .nr pg*col-num 0
 .nr pg@fn-bottom-margin 0



reply via email to

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