This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] readelf: prevent segfault


Marek Polacek <mpolacek@redhat.com> writes:

> On 03/22/2011 09:51 AM, Petr Machata wrote:
>>> -	case DT_PLTREL:
>>> -	  puts (ebl_dynamic_tag_name (ebl, dyn->d_un.d_val, NULL, 0));
>>> +	case DT_PLTREL:;
>> 
>> ...that semicolon. ^^^
>
> It's necessary, otherwise we'd get an error.  After label there has
> to be a statement and declaration isn't a statement.  And "case foo:" is just
> an ordinary label.  In readelf there are more places like this.

Personally I'd introduce {} block in that case, but if it's considered
normal, let's go with that.

PM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]