From dfb89db157f66b33b3e49a111fdfcf2cf1056241 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sat, 13 Jun 2026 15:30:42 -0700 Subject: [PATCH] tests: od: test command line arguments are checked for overflow * tests/od/od.pl ($INTMAX_OFLOW): Add definition. (@Tests): Test -j, -N, -S, and -w with $INTMAX_OFLOW. --- tests/od/od.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/od/od.pl b/tests/od/od.pl index 1e515c0269..b1dd46b034 100755 --- a/tests/od/od.pl +++ b/tests/od/od.pl @@ -19,6 +19,7 @@ use strict; my $limits = getlimits (); +my $INTMAX_OFLOW = $limits->{INTMAX_OFLOW}; (my $program_name = $0) =~ s|.*/||; @@ -101,6 +102,11 @@ my @Tests = {ERR=>"$prog: invalid -w argument 'w'\n"}], ); +push @Tests, + map {["$_-overflow", "-$_$INTMAX_OFLOW", + {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"od: -$_ argument '$INTMAX_OFLOW' too large\n"}]} qw(j N S w); + my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -- 2.47.3