mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
Fix compile time warning message for the AArch64 BFD backend, about a possible attempt to call sprintf on a NULL buffer pointer.
* elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check for malloc returning NULL. (_bfd_aarch64_erratum_843419_fixup): Check for _bfd_aarch64_erratum_835769_stub_name returning NULL.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2018-06-25 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
|
||||||
|
for malloc returning NULL.
|
||||||
|
(_bfd_aarch64_erratum_843419_fixup): Check for
|
||||||
|
_bfd_aarch64_erratum_835769_stub_name returning NULL.
|
||||||
|
|
||||||
2018-06-24 Nick Clifton <nickc@redhat.com>
|
2018-06-24 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* po/bfd.pot: Regenerate.
|
* po/bfd.pot: Regenerate.
|
||||||
|
@ -3745,7 +3745,8 @@ _bfd_aarch64_erratum_835769_stub_name (unsigned num_fixes)
|
|||||||
{
|
{
|
||||||
char *stub_name = (char *) bfd_malloc
|
char *stub_name = (char *) bfd_malloc
|
||||||
(strlen ("__erratum_835769_veneer_") + 16);
|
(strlen ("__erratum_835769_veneer_") + 16);
|
||||||
sprintf (stub_name,"__erratum_835769_veneer_%d", num_fixes);
|
if (stub_name != NULL)
|
||||||
|
sprintf (stub_name,"__erratum_835769_veneer_%d", num_fixes);
|
||||||
return stub_name;
|
return stub_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3992,6 +3993,8 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn,
|
|||||||
struct elf_aarch64_stub_hash_entry *stub_entry;
|
struct elf_aarch64_stub_hash_entry *stub_entry;
|
||||||
|
|
||||||
stub_name = _bfd_aarch64_erratum_843419_stub_name (section, ldst_offset);
|
stub_name = _bfd_aarch64_erratum_843419_stub_name (section, ldst_offset);
|
||||||
|
if (stub_name == NULL)
|
||||||
|
return FALSE;
|
||||||
stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
|
stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
|
||||||
FALSE, FALSE);
|
FALSE, FALSE);
|
||||||
if (stub_entry)
|
if (stub_entry)
|
||||||
@ -4009,8 +4012,7 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn,
|
|||||||
If we placed workaround veneers in any other stub section then we
|
If we placed workaround veneers in any other stub section then we
|
||||||
could not assume that all relocations have been processed on the
|
could not assume that all relocations have been processed on the
|
||||||
corresponding input section at the point we output the stub
|
corresponding input section at the point we output the stub
|
||||||
section.
|
section. */
|
||||||
*/
|
|
||||||
|
|
||||||
stub_entry = _bfd_aarch64_add_stub_entry_after (stub_name, section, htab);
|
stub_entry = _bfd_aarch64_add_stub_entry_after (stub_name, section, htab);
|
||||||
if (stub_entry == NULL)
|
if (stub_entry == NULL)
|
||||||
|
Reference in New Issue
Block a user