about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 600f5f9fe9..f42cb61ea3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -419,7 +419,7 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
 
 	  dirp->dirname = ((char *) dirp + sizeof (*dirp)
 			   + ncapstr * sizeof (enum r_dir_status));
-	  memcpy ((char *) dirp->dirname, cp, len + 1);
+	  *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0';
 	  dirp->dirnamelen = len;
 
 	  if (len > max_dirnamelen)