Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix an off-by-one in checking the return value of s...



details:   https://anonhg.NetBSD.org/src/rev/0548819295e5
branches:  trunk
changeset: 583202:0548819295e5
user:      peter <peter%NetBSD.org@localhost>
date:      Sat Jul 23 23:34:52 2005 +0000

description:
Fix an off-by-one in checking the return value of strlcpy(9).

Reviewed by atatat.

diffstat:

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

diffs (27 lines):

diff -r d448af190468 -r 0548819295e5 sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c    Sat Jul 23 22:04:12 2005 +0000
+++ b/sys/kern/kern_sysctl.c    Sat Jul 23 23:34:52 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sysctl.c,v 1.183 2005/06/20 02:49:18 atatat Exp $ */
+/*     $NetBSD: kern_sysctl.c,v 1.184 2005/07/23 23:34:52 peter Exp $  */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.183 2005/06/20 02:49:18 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.184 2005/07/23 23:34:52 peter Exp $");
 
 #include "opt_defcorename.h"
 #include "opt_insecure.h"
@@ -1899,7 +1899,7 @@
        /*
         * what's it called
         */
-       if (strlcpy(nnode.sysctl_name, namep, sizeof(nnode.sysctl_name)) >
+       if (strlcpy(nnode.sysctl_name, namep, sizeof(nnode.sysctl_name)) >=
            sizeof(nnode.sysctl_name))
                return (ENAMETOOLONG);
 



Home | Main Index | Thread Index | Old Index