diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-11 13:03:21 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-11 13:03:21 +1100 |
commit | 285ac91fa7b3cd4c8834ddb237c521a35adc438f (patch) | |
tree | b99aaee9966b8e200acae3f89c743de3bd452d90 | |
parent | 125f95edb7c1103cb4b0f6f9831e3aded9277f16 (diff) | |
download | skiboot-285ac91fa7b3cd4c8834ddb237c521a35adc438f.zip skiboot-285ac91fa7b3cd4c8834ddb237c521a35adc438f.tar.gz skiboot-285ac91fa7b3cd4c8834ddb237c521a35adc438f.tar.bz2 |
Check return result of sbe_xip_get_section in sbe_xip_image.c
In the event of failure, stringsSection will be untouched, which
is very likely not a good thing as then we'll just use garbage
in the following line.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | libpore/sbe_xip_image.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libpore/sbe_xip_image.c b/libpore/sbe_xip_image.c index 800892c..7ee4886 100644 --- a/libpore/sbe_xip_image.c +++ b/libpore/sbe_xip_image.c @@ -1070,8 +1070,11 @@ xipDecodeToc(void* i_image, o_item->iv_toc = i_imageToc; o_item->iv_type = hostToc.iv_type; o_item->iv_elements = hostToc.iv_elements; - - sbe_xip_get_section(i_image, SBE_XIP_SECTION_STRINGS, &stringsSection); + + rc = sbe_xip_get_section(i_image, SBE_XIP_SECTION_STRINGS, + &stringsSection); + if (rc) break; + o_item->iv_id = (char*)i_image + stringsSection.iv_offset + hostToc.iv_id; |