summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-03-01 09:27:37 +1100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2014-03-03 22:29:56 +0100
commit4bab5824e1551c7b0284e7155ef704b0b5359342 (patch)
tree18308b1943b11ce065709b845c3792c08dcba8b5 /src
parent2d5cec640132616b8336c60fdc426391ed800ef8 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/lib/selfboot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index dff66e5019..feff03e143 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;