From 81689ffd1549a3846ce2cda5142974f268795426 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 10 Dec 2010 20:58:56 +0000 Subject: Abort endless loops during roff macro and string expansion. For now, use the simplest conceivable approach, like groff does: Just a fixed, ugly input stack limit. "check it in" kristaps@ --- roff.7 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'roff.7') diff --git a/roff.7 b/roff.7 index 54afb5d0..f1f977d3 100644 --- a/roff.7 +++ b/roff.7 @@ -1,4 +1,4 @@ -.\" $Id: roff.7,v 1.15 2010/12/06 16:37:32 kristaps Exp $ +.\" $Id: roff.7,v 1.16 2010/12/10 20:58:56 schwarze Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons .\" Copyright (c) 2010 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 6 2010 $ +.Dd $Mdocdate: December 10 2010 $ .Dt ROFF 7 .Os .Sh NAME @@ -196,6 +196,12 @@ string interpolation syntax described below .Sx ds , but this is rarely useful because every macro definition contains at least one explicit newline character. +.Pp +In order to prevent endless recursion, both groff and +.Xr mandoc 1 +limit the stack depth for expanding macros and strings +to a large, but finite number. +Do not rely on the exact value of this limit. .Ss \&dei Define a user-defined .Nm -- cgit v1.2.3-56-ge451