[coreboot] [PATCH][RFC] LAR segfault when adding to a full archive

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Mar 28 11:39:44 CET 2008


On 28.03.2008 10:36, Stefan Reinauer wrote:
> NACK as long as the code adds #warnings. Please fix the issues and resubmit.
>   

The warning has been added because this is a preexisting bug/limitation
in the code. Whenever I find a bug which is destined to explode in the
future, I add a #warning to it. That allows other people to fix the bug
and makes sure the bug is not forgotten.

What is our official policy for bugs we find, but which we don't have
time to fix?
- Forget about them?
- Add a FIXME comment?
- Add a #warning?

Regards,
Carl-Daniel

> Carl-Daniel Hailfinger wrote:
>   
>> Index: util/lar/stream.c
>> ===================================================================
>> --- util/lar/stream.c	(Revision 646)
>> +++ util/lar/stream.c	(Arbeitskopie)
>> @@ -825,11 +827,16 @@
>>  int maxsize(struct lar *lar, char *name)
>>  {
>>  	int size;
>> -	u32 offset;
>> +	s64 offset;
>>  	int bootblock_size;
>>  
>>  	/* Find the beginning of the available space in the LAR */
>> +#warning We should check all chunks of free space in the LAR. Right now we do not return the maximum size, but the size of the first chunk.
>>  	offset = lar_empty_offset(lar);
>> +	if (offset < 0) {
>> +		err("maxsize is negative\n");
>> +		return offset;
>> +	}
>>  
>>  	/* Figure out how big our header will be */
>>  	size = get_bootblock_offset(lar->size) - offset - header_len(name,NULL) - 1;
>>     





More information about the coreboot mailing list