[PATCH 4/5] Refine size constraints applied to win32pstatus ELF notes

Jon Turney jon.turney@dronecode.org.uk
Wed Jul 15 13:22:08 GMT 2020


On 13/07/2020 16:04, Nick Clifton wrote:
> Hi Jon,
> 
>>       case NOTE_INFO_PROCESS:
>> +      if (note->descsz < 12)
>> +        return TRUE;
>> +
> 
> Shouldn't this return, and the later ones, be "return FALSE" ?
> After all you have a note type but insufficient space for valid note data.

Yes, you are right.  Revised patches to follow.

> Actually it looks to me like almost all of the returns in this function
> should be "return FALSE" as there is something wrong with the note...

Perhaps the way this is written at the moment is a bit awkward as we 
don't really distinguish in the return code between (i) the contents of 
the note are malformed, and (ii) an internal error occurred while 
processing the note. Do we really want to stop with an error in both cases?


More information about the Binutils mailing list