From d5e00bd29828468673420c552e7f027be8c43e02 Mon Sep 17 00:00:00 2001 From: Alastair Hughes Date: Fri, 24 Aug 2018 21:57:44 +1200 Subject: [PATCH] Avoid hangs when calling ldd.fakechroot with unknown arguments --- scripts/ldd.fakechroot.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ldd.fakechroot.pl b/scripts/ldd.fakechroot.pl index a4dfe70..69c9b6c 100755 --- a/scripts/ldd.fakechroot.pl +++ b/scripts/ldd.fakechroot.pl @@ -155,11 +155,6 @@ sub load_ldsoconf { MAIN: { my @args = @ARGV; - if (not @args) { - print STDERR "fakeldd: missing file arguments\n"; - exit 1; - } - if (not `sh -c 'command -v objdump'`) { print STDERR "fakeldd: objdump: command not found: install binutils package\n"; exit 1; @@ -170,10 +165,15 @@ MAIN: { while ($args[0] =~ /^-/) { my $arg = $args[0]; - shift @ARGV; + shift @args; last if $arg eq "--"; } + if (not @args) { + print STDERR "fakeldd: missing file arguments\n"; + exit 1; + } + foreach my $file (@args) { %Libs = (); $Dynamic = 0; -- 2.33.0