summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Dpkg/Copyright/Scanner.pm1
-rw-r--r--t/scanner/examples/binary-copyright-empty.inbin0 -> 90 bytes
-rw-r--r--t/scanner/examples/binary-copyright-empty.out4
-rw-r--r--t/scanner/examples/binary-copyright.inbin0 -> 12330 bytes
-rw-r--r--t/scanner/examples/binary-copyright.out4
5 files changed, 9 insertions, 0 deletions
diff --git a/lib/Dpkg/Copyright/Scanner.pm b/lib/Dpkg/Copyright/Scanner.pm
index b35af999..453825a3 100644
--- a/lib/Dpkg/Copyright/Scanner.pm
+++ b/lib/Dpkg/Copyright/Scanner.pm
@@ -282,6 +282,7 @@ sub scan_files ( %args ) {
$c =~ s!^[\s,/*]|[\s,#/*-]+$!!g;
$c =~ s/--/-/g;
$c =~ s!\s+\*/\s+! !;
+ $c =~ s![\x00-\x1f].*!!; # cut off everything after and including the first non-printable
$c = __pack_copyright($c);
diff --git a/t/scanner/examples/binary-copyright-empty.in b/t/scanner/examples/binary-copyright-empty.in
new file mode 100644
index 00000000..55fb1115
--- /dev/null
+++ b/t/scanner/examples/binary-copyright-empty.in
Binary files differ
diff --git a/t/scanner/examples/binary-copyright-empty.out b/t/scanner/examples/binary-copyright-empty.out
new file mode 100644
index 00000000..2ddf1439
--- /dev/null
+++ b/t/scanner/examples/binary-copyright-empty.out
@@ -0,0 +1,4 @@
+Files: *
+Copyright: UNKNOWN
+License: UNKNOWN
+
diff --git a/t/scanner/examples/binary-copyright.in b/t/scanner/examples/binary-copyright.in
new file mode 100644
index 00000000..b11bfb88
--- /dev/null
+++ b/t/scanner/examples/binary-copyright.in
Binary files differ
diff --git a/t/scanner/examples/binary-copyright.out b/t/scanner/examples/binary-copyright.out
new file mode 100644
index 00000000..05193e3a
--- /dev/null
+++ b/t/scanner/examples/binary-copyright.out
@@ -0,0 +1,4 @@
+Files: *
+Copyright: ÿyŠÿt}kÿoiEÿiP
+License: UNKNOWN
+