From 4bab5824e1551c7b0284e7155ef704b0b5359342 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sat, 1 Mar 2014 09:27:37 +1100 Subject: 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 Reviewed-on: http://review.coreboot.org/5314 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/lib/selfboot.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib') diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index dff66e5..feff03e 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -263,6 +263,9 @@ static int build_self_segment_list( ntohl(segment->mem_len)); new = malloc(sizeof(*new)); 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_memsz = ntohl(segment->mem_len); break; -- cgit v1.1