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

Christos Zoulas christos at zoulas.com
Fri Jun 26 17:08:52 UTC 2020


I have disabled the test for now.

christos

> On Jun 23, 2020, at 7:20 PM, Christos Zoulas <christos at zoulas.com> wrote:
> 
> Signed PGP part
> I think that Jörg made that change and can comment about it?
> 
> christos
> 
>> On Jun 23, 2020, at 1:28 PM, Avinash Sonawane <rootkea at gmail.com> wrote:
>> 
>>> 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
>> --
>> File mailing list
>> File at astron.com
>> https://mailman.astron.com/mailman/listinfo/file
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20200626/fe104443/attachment.asc>


More information about the File mailing list