[File] [PATCH] Fix processing g-ir typelib files on big-endian platforms

Christos Zoulas christos at zoulas.com
Tue Jun 23 16:17:20 UTC 2020


Committed, thanks!

christos

> On Jun 21, 2020, at 7:31 PM, Michael Catanzaro <mcatanzaro at redhat.com> wrote:
> 
> Hi,
> 
> On big-endian platforms, file prints incorrect results when processing
> gobject-introspection typelib files, e.g.:
> 
> G-IR binary database, v4.0, 35072 entries/17664 local
> 
> Whereas on little-endian platforms, the results are correct:
> 
> G-IR binary database, v4.0, 137 entries/69 local
> 
> Notice that:
> 
> 137 == 0x0089, 35072 == 0x8900
> 69 == 0x0045, 17664 == 0x4500
> 
> So the values are stored in host byte order.
> 
> Signed-off-by: Michael Catanzaro <mcatanzaro at gnome.org>
> ---
> magic/Magdir/gnome | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/magic/Magdir/gnome b/magic/Magdir/gnome
> index 2905340c..ddf45957 100644
> --- a/magic/Magdir/gnome
> +++ b/magic/Magdir/gnome
> @@ -55,5 +55,5 @@
> 0 string GOBJ\nMETADATA\r\n\032 G-IR binary database
> >16 byte x \b, v%d
> >17 byte x \b.%d
> ->20 leshort x \b, %d entries
> ->22 leshort x \b/%d local
> +>20 short x \b, %d entries
> +>22 short x \b/%d local
> 
> 
> --
> 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/20200623/7455c077/attachment.asc>


More information about the File mailing list