From 3b18ea9139a1bdd9183db6f3ac6d174ad93b3cb3 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 24 Apr 2022 13:38:46 +0000 Subject: If a .shift request has a negative argument, do not use a negative array index but use 0 instead of the argument, just like groff. Warn about the invalid argument. While here, fix the column number in another warning message. Segfault reported by tb@, found with afl(1). --- mandoc.1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mandoc.1') diff --git a/mandoc.1 b/mandoc.1 index 176ccf9c..415769b3 100644 --- a/mandoc.1 +++ b/mandoc.1 @@ -1,6 +1,6 @@ -.\" $Id: mandoc.1,v 1.256 2022/04/14 10:10:22 schwarze Exp $ +.\" $Id: mandoc.1,v 1.257 2022/04/24 13:38:46 schwarze Exp $ .\" -.\" Copyright (c) 2012, 2014-2021 Ingo Schwarze +.\" Copyright (c) 2012, 2014-2022 Ingo Schwarze .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -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: April 14 2022 $ +.Dd $Mdocdate: April 24 2022 $ .Dt MANDOC 1 .Os .Sh NAME @@ -2082,6 +2082,13 @@ and expands to the empty string. .Pq roff The argument of the escape sequence \e$ is not a digit; the escape sequence expands to the empty string. +.It Sy "negative argument, using 0" +.Pq roff +A +.Ic \&shift +request has a negative argument +or an argument that is negative due to integer overflow. +Macro argument numbering remains unchanged. .It Sy "NOT IMPLEMENTED: Bd -file" .Pq mdoc For security reasons, the -- cgit v1.2.3