[coreboot] [PATCH] flashrom: Improve coreboot image detection heuristic
Stefan Reinauer
stepan at coresystems.de
Fri Jul 4 15:28:54 CEST 2008
Carl-Daniel Hailfinger wrote:
> On 03.07.2008 18:46, Peter Stuge wrote:
>
>> On Thu, Jul 03, 2008 at 04:28:54PM +0200, Carl-Daniel Hailfinger wrote:
>>
>>
>>> + if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size ||
>>> + *(walk - 1) > size || *(walk - 2) > size ||
>>> + (!isprint((const char *)(bios + size - *(walk - 1))) &&
>>> + ((const char *)(bios + size - *(walk - 1)))) ||
>>> + (!isprint((const char *)(bios + size - *(walk - 2))) &&
>>> + ((const char *)(bios + size - *(walk - 2))))) {
>>>
>>>
>> I am in total disbelief. I should probably not be wasting any more of
>> my time on cleanups and restructuring.
>>
>>
>
> Well, this is the only reliable fix until somebody steps forward to
> implement LAR recognition for flashrom and fake LAR headers for v2 and
> we agree on a standard for encapsulating vendor/model information in a
> LAR. I don't see that happening in the next few weeks.
>
Reliable yes, but reliably wrong, unfortunately. It checks whether a
pointer is printable, which makes absolutely no sense.
Shame on me I acked this.
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
More information about the coreboot
mailing list