Module Name:    src
Committed By:   mrg
Date:           Sun Oct 13 20:18:42 UTC 2019

Modified Files:
        src/libexec/ld.elf_so: search.c

Log Message:
use strlcpy to ensure termination.

the buffer is statically sized so that it works without an
allocator, so truncation is the desired effect here.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/libexec/ld.elf_so/search.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/search.c
diff -u src/libexec/ld.elf_so/search.c:1.25 src/libexec/ld.elf_so/search.c:1.26
--- src/libexec/ld.elf_so/search.c:1.25	Sat Jan 12 18:58:10 2019
+++ src/libexec/ld.elf_so/search.c	Sun Oct 13 20:18:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: search.c,v 1.25 2019/01/12 18:58:10 christos Exp $	 */
+/*	$NetBSD: search.c,v 1.26 2019/10/13 20:18:42 mrg Exp $	 */
 
 /*
  * Copyright 1996 Matt Thomas <m...@3am-software.com>
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: search.c,v 1.25 2019/01/12 18:58:10 christos Exp $");
+__RCSID("$NetBSD: search.c,v 1.26 2019/10/13 20:18:42 mrg Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -138,7 +138,7 @@ _rtld_load_library(const char *name, con
 
 	tmperrorp = dlerror();
 	if (tmperrorp != NULL) {
-		strncpy(tmperror, tmperrorp, sizeof tmperror);
+		strlcpy(tmperror, tmperrorp, sizeof(tmperror));
 		tmperrorp = tmperror;
 	}
 

Reply via email to