diff options
| -rw-r--r-- | core/src/xmake/utils/bin2coff.c | 10 | ||||
| -rw-r--r-- | xmake/modules/private/utils/bin2obj.lua | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/src/xmake/utils/bin2coff.c b/core/src/xmake/utils/bin2coff.c index d48d89e09..426aab089 100644 --- a/core/src/xmake/utils/bin2coff.c +++ b/core/src/xmake/utils/bin2coff.c @@ -145,7 +145,7 @@ static tb_bool_t xm_utils_bin2coff_dump(tb_stream_ref_t istream, // get file size tb_hong_t filesize = tb_stream_size(istream); - if (filesize < 0) { + if (filesize < 0 || filesize > 0xffffffffU) { return tb_false; } tb_uint32_t datasize = (tb_uint32_t)filesize; @@ -304,13 +304,13 @@ static tb_bool_t xm_utils_bin2coff_dump(tb_stream_ref_t istream, // write string table tb_stream_bwrit(ostream, (tb_byte_t const *)&string_table_size, 4); - if (tb_strlen(symbol_start) > 8) { - xm_utils_bin2coff_write_string(ostream, symbol_start, 0); + if (start_len > 8) { + xm_utils_bin2coff_write_string(ostream, symbol_start, start_len); tb_byte_t null = 0; tb_stream_bwrit(ostream, &null, 1); } - if (tb_strlen(symbol_end) > 8) { - xm_utils_bin2coff_write_string(ostream, symbol_end, 0); + if (end_len > 8) { + xm_utils_bin2coff_write_string(ostream, symbol_end, end_len); tb_byte_t null = 0; tb_stream_bwrit(ostream, &null, 1); } diff --git a/xmake/modules/private/utils/bin2obj.lua b/xmake/modules/private/utils/bin2obj.lua index 7ee7ea3a1..37c78b633 100644 --- a/xmake/modules/private/utils/bin2obj.lua +++ b/xmake/modules/private/utils/bin2obj.lua @@ -31,7 +31,7 @@ local options = { function _do_bin2obj_coff(binarypath, outputpath, opt) -- get symbol prefix - local symbol_prefix = opt["symbol-prefix"] or opt.symbol_prefix or "_binary_" + local symbol_prefix = opt["symbol-prefix"] or "_binary_" -- get architecture local arch = opt.arch |
