[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/03: dplint: Avoid passing @ARGV on the stack



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit b693d9430618e6a5cb13d8deb71c1360e0f8cfe5
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 22 09:22:13 2017 +0000

    dplint: Avoid passing @ARGV on the stack
    
    If we pass @ARGV on the stack, we can end up with a Bizarre Copy/copy
    freed scalar error.
    
    Bug: https://rt.perl.org/Public/Bug/Display.html?id=131192
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 frontend/dplint | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/frontend/dplint b/frontend/dplint
index 5b39552..691ac25 100755
--- a/frontend/dplint
+++ b/frontend/dplint
@@ -85,7 +85,7 @@ sub error {
 }
 
 sub run_tool {
-    my ($truename, $tool, @args) = @_;
+    my ($truename, $tool) = @_;
     for my $include_dir (@INCLUDE_DIRS) {
         my $tool_path = "$include_dir/commands/${tool}";
         my $tool_pm_path = "${tool_path}.pm";
@@ -95,12 +95,12 @@ sub run_tool {
             }
             {
                 # Scope here it to avoid a warning about exec not returning.
-                exec {$tool_path} $truename, @args;
+                exec {$tool_path} $truename, @ARGV;
             }
             local $" = ' ';
             error(
                 "Running $tool failed!",
-                "  Command: $tool_path @args",
+                "  Command: $tool_path @ARGV",
                 "  Error from exec: $!"
             );
         }
@@ -282,7 +282,7 @@ sub main {
         error("Built-in $cmd returned unexpectedly");
     }
     $truename //= $cmd;
-    run_tool($truename, $cmd, @ARGV);
+    run_tool($truename, $cmd);
     error('run_tool returned unexpectedly');
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: