[File] [PATCH] Fix broken BMP detection since 5.38

Avinash Sonawane rootkea at gmail.com
Tue Jun 23 17:28:56 UTC 2020


> Hi, Any update on this?

Yes, any update on this? This has already been reported downstream [0]
and causing applications using libmagic to fail for bmp files as
reported here [1].

> *From:* Huki <gk7huki at gmail.com>
> *Sent:* Sat, 29 Feb 2020 20:23:23 +0530
> *To:* Christos Zoulas <christos at zoulas.com>, Jörg Jenderek
> <joerg.jen.der.ek at gmx.net>
> *Cc:* file mailinglist <file at astron.com>
> *Subject:* Re: [File] [PATCH] Fix broken BMP detection since 5.38
>
> Here is a test bitmap file that is broken in v5.38:
> http://rv12.revoltzone.net/downloads/file-5.38-test.bmp.gz

Another test bmp file is attached in ristretto bug report [1].

> The output:
>
> $ file test.bmp
> test.bmp: data
>
>
> The expected result (I've used my patched magic.mgc):
>
> $ file -m magic.mgc test.bmp
> test.bmp: PC bitmap, Windows 3.x format, 1024 x 1024 x 24, image size 3145728, resolution 11811 x 11811 px/m, cbSize 3145782, bits offset 54
>
>
> The problem is caused by this line which doesn't behave as expected when
> the file size is too big:
>
> # jump 4 bytes before end of file/header to skip fmt-116-signature-id-118.dib
> >>(2.l-4) ulong x PC bitmap, Windows 3.x format

Can maintainers please confirm the fix and merge the patch?

Thanks!

[0] https://bugs.launchpad.net/ubuntu/+source/file/+bug/1879019
[1] https://bugs.launchpad.net/ubuntu/+source/ristretto/+bug/1762242

Regards,
Avinash Sonawane (rootKea)
PICT, Pune
https://rootkea.wordpress.com


More information about the File mailing list