GNU Binutils with patches for OS216
Révision | 4a9f7d653c089fdd8ca66a51caab7c9687f50cd1 (tree) |
---|---|
l'heure | 2018-08-01 22:42:37 |
Auteur | Nick Clifton <nickc@redh...> |
Commiter | Nick Clifton |
Fix potential illegal memory access in AVR backend.
* elf32-avr.c (avr_stub_name): Check for a NULL return from
bfd_malloc.
@@ -1,3 +1,8 @@ | ||
1 | +2018-08-01 Nick Clifton <nickc@redhat.com> | |
2 | + | |
3 | + * elf32-avr.c (avr_stub_name): Check for a NULL return from | |
4 | + bfd_malloc. | |
5 | + | |
1 | 6 | 2018-08-01 Zenith <zenith432@users.sourceforge.net> |
2 | 7 | |
3 | 8 | PR 23460 |
@@ -3295,10 +3295,10 @@ avr_stub_name (const asection *symbol_section, | ||
3295 | 3295 | |
3296 | 3296 | len = 8 + 1 + 8 + 1 + 1; |
3297 | 3297 | stub_name = bfd_malloc (len); |
3298 | - | |
3299 | - sprintf (stub_name, "%08x+%08x", | |
3300 | - symbol_section->id & 0xffffffff, | |
3301 | - (unsigned int) ((rela->r_addend & 0xffffffff) + symbol_offset)); | |
3298 | + if (stub_name != NULL) | |
3299 | + sprintf (stub_name, "%08x+%08x", | |
3300 | + symbol_section->id & 0xffffffff, | |
3301 | + (unsigned int) ((rela->r_addend & 0xffffffff) + symbol_offset)); | |
3302 | 3302 | |
3303 | 3303 | return stub_name; |
3304 | 3304 | } |