summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2006-09-25 17:44:41 +0900
committerSimon Horman <horms@verge.net.au>2006-11-27 12:25:13 +0900
commit0561bfc2fc6dccc706f12975f38cfb79fb5d63da (patch)
tree2220f4dca2cee8cbd76c254f0d13d40e74ed72bc
parentacc3c486f3172d13d550a7c58b4e047182e94127 (diff)
kexec-tool: i386: Only load known segments
This was a warning flagged by the compiler, that loadaddr may be used uninitilised. I'm not sure if this happens in practice, but it is possible, if the seg type is NBI_SEG_NEGATIVE, or some other undefined value. It seems best to print a warning and skip to the next segment in this case. But I'm not sure if this is correct. Signed-Off-By: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/i386/kexec-nbi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kexec/arch/i386/kexec-nbi.c b/kexec/arch/i386/kexec-nbi.c
index 00ba1c1..e771f89 100644
--- a/kexec/arch/i386/kexec-nbi.c
+++ b/kexec/arch/i386/kexec-nbi.c
@@ -216,6 +216,11 @@ int nbi_load(int argc, char **argv, const char *buf, off_t len,
else if ((seg.flags & NBI_SEG) == NBI_SEG_PREPEND) {
loadaddr = last0 - seg.loadaddr;
}
+ else {
+ printf("warning: unhandled segment of type %0x\n",
+ seg.flags & NBI_SEG);
+ continue;
+ }
add_segment(info, buf + file_off, seg.imglength,
loadaddr, seg.memlength);
last0 = loadaddr;