summaryrefslogtreecommitdiffstats
path: root/regress/roff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-08 13:18:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-08 13:18:10 +0000
commitfffc835e0eaec5783f8a4f5f0224609dff3476b7 (patch)
tree5a5bb4fd48c41e7ae604e67515aa8870a6bf84d8 /regress/roff
parent0048f6b4d138a5084ab0895e54f81bfa74d70f76 (diff)
downloadmandoc-fffc835e0eaec5783f8a4f5f0224609dff3476b7.tar.gz
prevent infinite recursion while expanding the arguments
of a user-defined macro; issue found by tb@ with afl(1)
Diffstat (limited to 'regress/roff')
-rw-r--r--regress/roff/de/infinite.in6
-rw-r--r--regress/roff/de/infinite.out_ascii2
-rw-r--r--regress/roff/de/infinite.out_lint1
3 files changed, 8 insertions, 1 deletions
diff --git a/regress/roff/de/infinite.in b/regress/roff/de/infinite.in
index 683eba7f..b6dac1f7 100644
--- a/regress/roff/de/infinite.in
+++ b/regress/roff/de/infinite.in
@@ -7,6 +7,12 @@
.Sh DESCRIPTION
initial text
.de mym
+.Op \\$1 \\$2
+..
+.mym $1 \$1
+.mym \$1 nothing
+middle text
+.de mym
.mym
not printed
..
diff --git a/regress/roff/de/infinite.out_ascii b/regress/roff/de/infinite.out_ascii
index 7f8210ab..17070a20 100644
--- a/regress/roff/de/infinite.out_ascii
+++ b/regress/roff/de/infinite.out_ascii
@@ -4,6 +4,6 @@ NNAAMMEE
ddee--iinnffiinniittee - inifinte recursion in a user-defined macro
DDEESSCCRRIIPPTTIIOONN
- initial text final text
+ initial text [$1 $1] middle text final text
OpenBSD March 7, 2017 OpenBSD
diff --git a/regress/roff/de/infinite.out_lint b/regress/roff/de/infinite.out_lint
index 168c7be4..7cea727c 100644
--- a/regress/roff/de/infinite.out_lint
+++ b/regress/roff/de/infinite.out_lint
@@ -1 +1,2 @@
mandoc: infinite.in:13:5: ERROR: input stack limit exceeded, infinite loop?
+mandoc: infinite.in:19:5: ERROR: input stack limit exceeded, infinite loop?