GNU Binutils with patches for OS216
Revisão | 340f3ac8082771ecc473ab938fc3d7cbf607ddaa (tree) |
---|---|
Hora | 2020-03-20 11:05:51 |
Autor | Alan Modra <amodra@gmai...> |
Commiter | Alan Modra |
metag uninitialized memory read
* metag-dis.c (print_insn_metag): Don't ignore status from
read_memory_func.
@@ -1,5 +1,10 @@ | ||
1 | 1 | 2020-03-20 Alan Modra <amodra@gmail.com> |
2 | 2 | |
3 | + * metag-dis.c (print_insn_metag): Don't ignore status from | |
4 | + read_memory_func. | |
5 | + | |
6 | +2020-03-20 Alan Modra <amodra@gmail.com> | |
7 | + | |
3 | 8 | * nds32-dis.c (print_insn_nds32): Remove unnecessary casts. |
4 | 9 | Initialize parts of buffer not written when handling a possible |
5 | 10 | 2-byte insn at end of section. Don't attempt decoding of such |
@@ -3364,9 +3364,15 @@ print_insn_metag (bfd_vma pc, disassemble_info *outf) | ||
3364 | 3364 | bfd_byte buf[4]; |
3365 | 3365 | unsigned int insn_word; |
3366 | 3366 | size_t i; |
3367 | - outf->bytes_per_chunk = 4; | |
3367 | + int status; | |
3368 | 3368 | |
3369 | - (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf); | |
3369 | + outf->bytes_per_chunk = 4; | |
3370 | + status = (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf); | |
3371 | + if (status) | |
3372 | + { | |
3373 | + (*outf->memory_error_func) (status, pc, outf); | |
3374 | + return -1; | |
3375 | + } | |
3370 | 3376 | insn_word = bfd_getl32 (buf); |
3371 | 3377 | |
3372 | 3378 | for (i = 0; i < sizeof(metag_optab)/sizeof(metag_optab[0]); i++) |