Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern use a bound string copy



details:   https://anonhg.NetBSD.org/src/rev/ec657f7f8f24
branches:  trunk
changeset: 820784:ec657f7f8f24
user:      maya <maya%NetBSD.org@localhost>
date:      Sun Jan 15 01:28:14 2017 +0000

description:
use a bound string copy

diffstat:

 sys/kern/sys_lwp.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 7ac52d7a1f95 -r ec657f7f8f24 sys/kern/sys_lwp.c
--- a/sys/kern/sys_lwp.c        Sun Jan 15 00:04:01 2017 +0000
+++ b/sys/kern/sys_lwp.c        Sun Jan 15 01:28:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $        */
+/*     $NetBSD: sys_lwp.c,v 1.58 2017/01/15 01:28:14 maya Exp $        */
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.58 2017/01/15 01:28:14 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -822,7 +822,7 @@
        if (t->l_name == NULL)
                name[0] = '\0';
        else
-               strcpy(name, t->l_name);
+               strlcpy(name, t->l_name, sizeof(name));
        lwp_unlock(t);
        mutex_exit(p->p_lock);
 



Home | Main Index | Thread Index | Old Index