Fix #7073 - fix oob read for not finalizing str

This commit is contained in:
alvarofe 2017-03-21 23:20:30 +01:00
parent db884ecd1d
commit f0f037b974

View File

@ -1454,7 +1454,7 @@ R_API int r_bin_dwarf_parse_info(RBinDwarfDebugAbbrev *da, RBin *a, int mode) {
debug_str = getsection (a, "debug_str");
if (debug_str) {
debug_str_len = debug_str->size;
debug_str_buf = calloc (1, debug_str_len);
debug_str_buf = calloc (1, debug_str_len + 1);
ret = r_buf_read_at (binfile->buf, debug_str->paddr,
debug_str_buf, debug_str_len);
if (!ret) {