diff options
author | Martin Liska <mliska@suse.cz> | 2019-07-24 09:00:48 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-07-24 07:00:48 +0000 |
commit | 70121844349587b23c3950e844021a22ab51638c (patch) | |
tree | 9e74e8d6e3ed32151539211c7b46d7403026e008 /libiberty | |
parent | fe1a06fc57cf535f8c4f7410944a993eeae81d4c (diff) | |
download | gcc-70121844349587b23c3950e844021a22ab51638c.zip gcc-70121844349587b23c3950e844021a22ab51638c.tar.gz gcc-70121844349587b23c3950e844021a22ab51638c.tar.bz2 |
Fix off-by-one in simple-object-elf.c (PR lto/91228).
2019-07-24 Martin Liska <mliska@suse.cz>
PR lto/91228
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Find first '\0' starting from gnu_lto + 1.
From-SVN: r273757
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 6 | ||||
-rw-r--r-- | libiberty/simple-object-elf.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index ddd9618..c22d49f 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2019-07-24 Martin Liska <mliska@suse.cz> + + PR lto/91228 + * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): + Find first '\0' starting from gnu_lto + 1. + 2019-07-12 Ren Kimura <rkx1209dev@gmail.com> * simple-object-elf.c (simple_object_elf_match): Check zero value shstrndx. diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c index bdee963..7515926 100644 --- a/libiberty/simple-object-elf.c +++ b/libiberty/simple-object-elf.c @@ -1388,8 +1388,8 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, (unsigned char *)strings, strsz, &errmsg, err); /* Find first '\0' in strings. */ - gnu_lto = (char *) memchr (gnu_lto, '\0', - strings + strsz - gnu_lto + 1); + gnu_lto = (char *) memchr (gnu_lto + 1, '\0', + strings + strsz - gnu_lto); /* Read the section index table if present. */ if (symtab_indices_shndx[i - 1] != 0) { |