mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 12:53:17 +08:00
PR binutils/22875: Visium/ELF: Prevent an out-of-bounds howto table access
Prevent an out-of-bounds `visium_elf_howto_table' table access in `visium_info_to_howto_rela' by using the size of the table rather than R_VISIUM_max to determine the number of entries in the contiguous regular Visium relocation range defined and described in the table. bfd/ * elf32-visium.c (visium_info_to_howto_rela): Correct the range check for `visium_elf_howto_table' table access.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2018-04-04 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* elf32-visium.c (visium_info_to_howto_rela): Correct the range
|
||||||
|
check for `visium_elf_howto_table' table access.
|
||||||
|
|
||||||
2018-04-04 Maciej W. Rozycki <macro@mips.com>
|
2018-04-04 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
* elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
|
* elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "libbfd.h"
|
#include "libbfd.h"
|
||||||
#include "elf-bfd.h"
|
#include "elf-bfd.h"
|
||||||
#include "elf/visium.h"
|
#include "elf/visium.h"
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
static bfd_reloc_status_type visium_elf_howto_parity_reloc
|
static bfd_reloc_status_type visium_elf_howto_parity_reloc
|
||||||
(bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
|
(bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
|
||||||
@ -475,7 +476,7 @@ visium_info_to_howto_rela (bfd *abfd, arelent *cache_ptr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (r_type >= (unsigned int) R_VISIUM_max)
|
if (r_type >= ARRAY_SIZE (visium_elf_howto_table))
|
||||||
{
|
{
|
||||||
/* xgettext:c-format */
|
/* xgettext:c-format */
|
||||||
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),
|
_bfd_error_handler (_("%pB: unsupported relocation type %#x"),
|
||||||
|
Reference in New Issue
Block a user