Fix a potential illegal memory access by objcopy when extracting dwo sections.
PR 26805 * objcopy.c (is_dwo_section): Check for missing or short section names.
This commit is contained in:
parent
0ad0e70c73
commit
00c19b8e78
2 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2020-10-29 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 26805
|
||||
* objcopy.c (is_dwo_section): Check for missing or short section
|
||||
names.
|
||||
|
||||
2020-10-26 Andreas Rammhold <andreas@rammhold.de>
|
||||
|
||||
* README-how-to-make-a-release: Use sha256sum instead of md5sum.
|
||||
|
|
|
@ -1268,8 +1268,15 @@ group_signature (asection *group)
|
|||
static bfd_boolean
|
||||
is_dwo_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
|
||||
{
|
||||
const char *name = bfd_section_name (sec);
|
||||
int len = strlen (name);
|
||||
const char *name;
|
||||
int len;
|
||||
|
||||
if (sec == NULL || (name = bfd_section_name (sec)) == NULL)
|
||||
return FALSE;
|
||||
|
||||
len = strlen (name);
|
||||
if (len < 5)
|
||||
return FALSE;
|
||||
|
||||
return strncmp (name + len - 4, ".dwo", 4) == 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue