mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 12:27:40 +00:00
Fix heap buffer overflow found by ASAN
This commit is contained in:
parent
2e24d9e55f
commit
67fbe02de9
@ -1881,7 +1881,7 @@ static const ut8 *parse_attr_value(const ut8 *obuf, int obuf_len, RBinDwarfAttrD
|
||||
ut8 *section = NULL;
|
||||
section = get_section_bytes (bin, section_name, §ion_len);
|
||||
if (section && value->string.offset < section_len) {
|
||||
char *ds = r_str_ndup ((const char *)(section + value->string.offset), section_len);
|
||||
char *ds = r_str_ndup ((const char *)(section + value->string.offset), section_len - 1);
|
||||
if (ds) {
|
||||
r_str_ansi_strip (ds);
|
||||
r_str_replace_ch (ds, '\n', 0, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user