Commit d55f56ec authored by Felix Lechner's avatar Felix Lechner Committed by Chris Lamb

Fix use of uninitialized value in checks/files.pm.

When running Lintian from master on a changes files that is not in the
current directory, Lintian emits the following error:

  Use of uninitialized value $1 in concatenation (.) or string at /lcl/lechner/lintian/git/checks/files.pm line 429

It can be reproduced on amd64 with a current master of Lintian by
running in the Lintian root (here called 'git'):

  cd ..
  dget http://deb.debian.org/debian/pool/main/m/mdadm/mdadm_4.1-2.dsc
  cd mdadm-4.1
  debuild
  ../git/frontend/lintian ../mdadm_4.1-2_amd64.changes

This commit checks for null before using the value.

Gbp-Dch: ignore
Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent 2045ea8f
Pipeline #60953 passed with stages
in 89 minutes and 59 seconds
...@@ -426,8 +426,11 @@ sub run { ...@@ -426,8 +426,11 @@ sub run {
# If we have a /usr/sbin/foo, check for references to # If we have a /usr/sbin/foo, check for references to
# /usr/bin/foo # /usr/bin/foo
push(@bin_binaries, "/$1bin/$2") if ($file->is_file) {
if $file->is_file and $fname =~ m,^(usr/)?sbin/(.+),; $fname =~ m,^(usr/)?sbin/(.+),;
push(@bin_binaries, "/$1bin/$2")
if length $1 && length $2;
}
$arch_dep_files = 1 $arch_dep_files = 1
if not $file->is_dir if not $file->is_dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment