bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/17141] New: Incorrect result check of _bfd_elf_strtab_add(


From: maksqwe1 at ukr dot net
Subject: [Bug binutils/17141] New: Incorrect result check of _bfd_elf_strtab_add() in bfd/elf.c
Date: Fri, 11 Jul 2014 12:05:48 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17141

            Bug ID: 17141
           Summary: Incorrect result check of _bfd_elf_strtab_add() in
                    bfd/elf.c
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: maksqwe1 at ukr dot net

bfd/elf.c 5255

  elf_tdata (abfd)->symtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".symtab", FALSE);
  elf_tdata (abfd)->strtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".strtab", FALSE);
  elf_tdata (abfd)->shstrtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", FALSE);

  if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 // <===
   || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 // <===
   || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1)
    return FALSE;

Copy/paste typo. Should be:
  if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1
   || elf_tdata (abfd)->strtab_hdr.sh_name == (unsigned int) -1
   || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1)
    return FALSE;

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]