Subject: kern/25277: kernfs int to size_t corrections
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jeffi@rcn.com>
List: netbsd-bugs
Date: 04/22/2004 00:33:08
>Number:         25277
>Category:       kern
>Synopsis:       kernfs int to size_t corrections
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 22 00:34:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jeff Ito
>Release:        NetBSD 2.0B
>Organization:
>Environment:
NetBSD netbsd 2.0B NetBSD 2.0B (LAB) #0: Fri Apr  2 10:31:30 EST 2004
>Description:
correct int -> size_t for various length values.  These are more in-line with what subsequent function calls expect as arguments.
>How-To-Repeat:
n/a
>Fix:
Index: kernfs_vnops.c
===================================================================
RCS file: /cvs/nbsd/src/sys/miscfs/kernfs/kernfs_vnops.c,v
retrieving revision 1.98
diff -u -r1.98 kernfs_vnops.c
--- kernfs_vnops.c      27 Sep 2003 13:29:02 -0000      1.98
+++ kernfs_vnops.c      22 Apr 2004 00:27:14 -0000
@@ -304,7 +304,7 @@
 
        case KFShostname: {
                char *cp = hostname;
-               int xlen = hostnamelen;
+               size_t xlen = hostnamelen;
 
                if (xlen >= (len - 2))
                        return (EINVAL);
@@ -775,7 +775,8 @@
        } */ *ap = v;
        struct kernfs_node *kfs = VTOKERN(ap->a_vp);
        struct uio *uio = ap->a_uio;
-       int error, xlen;
+       int error;
+       size_t xlen;
        char strbuf[KSTRING];
 
        if (uio->uio_offset != 0)

>Release-Note:
>Audit-Trail:
>Unformatted: