@B fix possible buffer overrun

This commit is contained in:
bebbo 2017-03-22 21:51:10 +01:00
parent 771f273346
commit 5781371c30
1 changed files with 1 additions and 1 deletions

View File

@ -1756,7 +1756,7 @@ _bfd_write_archive_contents (arch)
struct ar_hdr hdr;
memset ((char *) (&hdr), 0, sizeof (struct ar_hdr));
strcpy (hdr.ar_name, ename);
strncpy (hdr.ar_name, ename, 16);
/* Round size up to even number in archive header. */
_bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld",
(elength + 1) & ~(bfd_size_type) 1);