aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-12-17 11:01:25 +0000
committerNick Clifton <nickc@redhat.com>2002-12-17 11:01:25 +0000
commit2a8ac465c4b542038e321e806ae27d301ad1fca5 (patch)
tree2a8fd9360f848c8e5a3f95052a6d9ea37fcab8c1 /ld
parenta08a0d635b7e6d78dca2ac21d9367f066b553bea (diff)
downloadfsf-binutils-gdb-2a8ac465c4b542038e321e806ae27d301ad1fca5.zip
fsf-binutils-gdb-2a8ac465c4b542038e321e806ae27d301ad1fca5.tar.gz
fsf-binutils-gdb-2a8ac465c4b542038e321e806ae27d301ad1fca5.tar.bz2
Use LD_PATHMAX+1 to account for trailing '\0'.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/pe.em4
2 files changed, 7 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 02d9e42..2a84e62 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-17 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * emultempl/pe.em (..._recognized_file): Use LD_PATHMAX+1 to
+ account for trailing '\0'.
+
2002-12-17 Nick Clifton <nickc@redhat.com>
* emultempl/pe.em (longopts): Duplicate entry for --compact-implib
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 061401f..27a059d 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1392,11 +1392,11 @@ gld_${EMULATION_NAME}_recognized_file (entry)
#endif
if (bfd_get_format (entry->the_bfd) == bfd_object)
{
- char fbuf[LD_PATHMAX];
+ char fbuf[LD_PATHMAX + 1];
const char *ext;
if (REALPATH (entry->filename, fbuf) == NULL)
- strncpy (fbuf, entry->filename, LD_PATHMAX);
+ strncpy (fbuf, entry->filename, sizeof (fbuf));
ext = fbuf + strlen (fbuf) - 4;