lib/selfboot: s_srcaddr is uninitialized.

s_srcaddr is uninitialized in the BSS section, leading to a
garbage valued operand on the LHS of a '<' on line 383.

Change-Id: Ie4fec91b09c70fb1d91ad3918ac3f60653fa1d83
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/5314
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
Edward O'Callaghan 2014-03-01 09:27:37 +11:00 committed by Stefan Reinauer
parent 2d5cec6401
commit 4bab5824e1
1 changed files with 3 additions and 0 deletions

View File

@ -263,6 +263,9 @@ static int build_self_segment_list(
ntohl(segment->mem_len)); ntohl(segment->mem_len));
new = malloc(sizeof(*new)); new = malloc(sizeof(*new));
new->s_filesz = 0; new->s_filesz = 0;
new->s_srcaddr = (uintptr_t)
((unsigned char *)first_segment)
+ ntohl(segment->offset);
new->s_dstaddr = ntohll(segment->load_addr); new->s_dstaddr = ntohll(segment->load_addr);
new->s_memsz = ntohl(segment->mem_len); new->s_memsz = ntohl(segment->mem_len);
break; break;