bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/22444] Incorrect note padding check


From: hjl.tools at gmail dot com
Subject: [Bug binutils/22444] Incorrect note padding check
Date: Thu, 16 Nov 2017 00:01:15 +0000

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
elf.c has the same issue:

    /* FIXME: bad alignment assumption.  */
      Elf_External_Note *xnp = (Elf_External_Note *) p; 
      Elf_Internal_Note in;

      if (offsetof (Elf_External_Note, name) > buf - p + size) 
        return FALSE;

      in.type = H_GET_32 (abfd, xnp->type);

      in.namesz = H_GET_32 (abfd, xnp->namesz);
      in.namedata = xnp->name;
      if (in.namesz > buf - in.namedata + size)
        return FALSE;

      in.descsz = H_GET_32 (abfd, xnp->descsz);
      in.descdata = in.namedata + BFD_ALIGN (in.namesz, 4);
      in.descpos = offset + (in.descdata - buf);

-- 
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]