forked from pool/perl-File-Unpack
- Add 10.diff from yet another pull request: https://github.com/jnweiger/perl-File-Unpack/pull/10 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-File-Unpack?expand=0&rev=96
18 lines
683 B
Diff
18 lines
683 B
Diff
diff --git a/Unpack.pm b/Unpack.pm
|
|
index d5354ac..69ef617 100644
|
|
--- a/Unpack.pm
|
|
+++ b/Unpack.pm
|
|
@@ -2301,7 +2301,11 @@ sub mime
|
|
|
|
## flm can say 'cannot open \'IP\' (No such file or directory)'
|
|
## flm can say 'CDF V2 Document, corrupt: Can\'t read SAT' (application/vnd.ms-excel)
|
|
- my $mime1 = $flm->checktype_contents($in{buf});
|
|
+ my $mime1 = eval { $flm->checktype_contents($in{buf}) };
|
|
+ if ($@) {
|
|
+ warn $@;
|
|
+ return [ 'x-system/x-error', undef, "libmimemagic exception"];
|
|
+ }
|
|
if ($mime1 =~ m{, corrupt: } or $mime1 =~ m{^application/octet-stream\b})
|
|
{
|
|
# application/x-iso9660-image is reported as application/octet-stream if the buffer is short.
|