[Rpm-maint] [PATCH 5/5] Fix handling of zero-length file digests

Panu Matilainen pmatilai at laiskiainen.org
Thu Apr 28 06:20:31 UTC 2016


On 04/27/2016 11:00 PM, Stefan Berger wrote:
> "Rpm-maint" <rpm-maint-bounces at lists.rpm.org> wrote on 04/27/2016
> 05:45:56 AM:
>
>>
>> I get the following warning:
>>
>> ima.c:23:1: warning: ‘PACKED’ attribute directive ignored [-Wattributes]
>>  } __attribute__((PACKED));
>>
>> May be there is an simpler way to check for the header being zeros only?
>
> One way of doing it would be to create an array of 9 zero bytes (with a
> comment of what it represents) and compare against that.

Yes, and there's precedent for that in rpm, at least:
http://rpm.org/gitweb?p=rpm.git;a=blob;f=rpmio/rpmkeyring.c;h=ac3e3bc5ab4cc240318605e2f82797872f19604e;hb=HEAD#l218

> I guess you wouldn't like gcc #pragma tricks to disable -Wattributes in
> this case.

Compiler specifics are nasty, no need for that here because there's a 
simple, standard solution.

	- Panu -



More information about the Rpm-maint mailing list