diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2018-02-06 10:37:04 -0500 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2018-02-06 11:47:24 -0500 |
commit | 8278e7cec35536046caf596f4e55c7c037d06cf0 (patch) | |
tree | f104d283dcb40f452c157d864b3189595a58d9f3 /gdb/mep-tdep.c | |
parent | 68807c3cd64ccc4f0e9261df3e840d30d9a19b51 (diff) | |
download | gdb-8278e7cec35536046caf596f4e55c7c037d06cf0.zip gdb-8278e7cec35536046caf596f4e55c7c037d06cf0.tar.gz gdb-8278e7cec35536046caf596f4e55c7c037d06cf0.tar.bz2 |
Fix GCC 8's -Wstringop-overflow on bfd/coff-rs6000.c
GCC 8 will bring a new warning option which will detect possible
overflow and truncation on string manipulation functions. For more
details, see:
https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00471.html
While compiling BFD with it, I can see one place on bfd/coff-rs6000.c
where the warning is triggered. This:
(void) strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG);
will not include the trailing NUL on fhdr.magic, but that's fine
because it's a magic number. The fix is trivial: just use memcpy
instead.
OK to push?
2018-02-06 Sergio Durigan Junior <sergiodj@redhat.com>
* coff-rs6000.c (xcoff_write_archive_contents_old): Use
'memcpy' instead of 'strncpy' when writing the magic number.
Diffstat (limited to 'gdb/mep-tdep.c')
0 files changed, 0 insertions, 0 deletions