diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2013-07-12 10:29:16 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-08-02 14:27:03 -0500 |
commit | 8ee8f25d810e45c03f7d8f2e9a116445c5ff4376 (patch) | |
tree | 2909945d78953a6131a3fbcd561c12c113f9cffe | |
parent | 095dd5c1cb729f749d6c6276851ff714b61990bf (diff) | |
download | blackbird-hostboot-8ee8f25d810e45c03f7d8f2e9a116445c5ff4376.tar.gz blackbird-hostboot-8ee8f25d810e45c03f7d8f2e9a116445c5ff4376.zip |
Fix potential buffer overrun in genlist.
Change-Id: Ie0210ec7a136613a5407466af827d6a74e534876
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5648
Tested-by: Jenkins Server
Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/build/linker/genlist.C | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/build/linker/genlist.C b/src/build/linker/genlist.C index 0f2556ade..64ba7c806 100644 --- a/src/build/linker/genlist.C +++ b/src/build/linker/genlist.C @@ -289,7 +289,7 @@ string find_symbol_name(uint64_t addr, bool match) // Create the "symbol+offset" string. else { - char hex[16]; + char hex[17]; sprintf(hex, "%lx", addr - sym->first); return sym->second + string("+0x") + hex; @@ -409,7 +409,7 @@ void* read_module_content(void* input) result += string(line, matches[2].rm_eo); result += "\t"; // Output offsetted address. - char addr_text[16]; + char addr_text[17]; sprintf(addr_text, "%08lx", addr_value); result += addr_text; @@ -431,7 +431,7 @@ void* read_module_content(void* input) uint64_t branch_addr = 0; sscanf(&line[matches[2].rm_so], "%lx", &branch_addr); branch_addr += mod_addr; - char branch_addr_txt[16]; + char branch_addr_txt[17]; sprintf(branch_addr_txt, "%lx", branch_addr); result += branch_addr_txt; |