From 43f9fbf1c67bd7237ef7670c2fd3019a4bbc84f0 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). --- regress/roff/shift/bad.out_ascii | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'regress/roff/shift/bad.out_ascii') diff --git a/regress/roff/shift/bad.out_ascii b/regress/roff/shift/bad.out_ascii index 2d6a2922..ddb8c521 100644 --- a/regress/roff/shift/bad.out_ascii +++ b/regress/roff/shift/bad.out_ascii @@ -14,8 +14,10 @@ DDEESSCCRRIIPPTTIIOONN argument used after call: "" - after shift badarg: "arg2" after excessive shift: 0 "" + after shift badarg: "arg2" + after shift -1: "arg2" + after excessive shift: 0 "" final text -OpenBSD August 23, 2018 SHIFT_BAD(1) +OpenBSD April 24, 2022 SHIFT_BAD(1) -- cgit