Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/nfs kill sprintf.



details:   https://anonhg.NetBSD.org/src/rev/e38a02ff58a6
branches:  trunk
changeset: 794814:e38a02ff58a6
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 25 16:30:28 2014 +0000

description:
kill sprintf.

diffstat:

 sys/fs/nfs/client/nfs_clvnops.c  |  6 +++---
 sys/fs/nfs/server/nfs_nfsdkrpc.c |  6 +++---
 sys/fs/nfs/server/nfs_nfsdserv.c |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (83 lines):

diff -r 6b6e5d727944 -r e38a02ff58a6 sys/fs/nfs/client/nfs_clvnops.c
--- a/sys/fs/nfs/client/nfs_clvnops.c   Tue Mar 25 16:28:15 2014 +0000
+++ b/sys/fs/nfs/client/nfs_clvnops.c   Tue Mar 25 16:30:28 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_clvnops.c,v 1.1.1.1 2013/09/30 07:19:20 dholland Exp $     */
+/*     $NetBSD: nfs_clvnops.c,v 1.2 2014/03/25 16:30:28 christos Exp $ */
 /*-
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 252072 2013-06-21 22:26:18Z rmacklem "); */
-__RCSID("$NetBSD: nfs_clvnops.c,v 1.1.1.1 2013/09/30 07:19:20 dholland Exp $");
+__RCSID("$NetBSD: nfs_clvnops.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
 
 /*
  * vnode op calls for Sun NFS version 2, 3 and 4
@@ -2428,7 +2428,7 @@
        pid = cnp->cn_thread->td_proc->p_pid;
        lticks = (unsigned int)ticks;
        for ( ; ; ) {
-               sp->s_namlen = sprintf(sp->s_name, 
+               sp->s_namlen = snprintf(sp->s_name, sizeof(sp->s_name),
                                       ".nfs.%08x.%04x4.4", lticks, 
                                       pid);
                if (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
diff -r 6b6e5d727944 -r e38a02ff58a6 sys/fs/nfs/server/nfs_nfsdkrpc.c
--- a/sys/fs/nfs/server/nfs_nfsdkrpc.c  Tue Mar 25 16:28:15 2014 +0000
+++ b/sys/fs/nfs/server/nfs_nfsdkrpc.c  Tue Mar 25 16:30:28 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_nfsdkrpc.c,v 1.1.1.1 2013/09/30 07:19:53 dholland Exp $    */
+/*     $NetBSD: nfs_nfsdkrpc.c,v 1.2 2014/03/25 16:30:28 christos Exp $        */
 /*-
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("FreeBSD: head/sys/fs/nfsserver/nfs_nfsdkrpc.c 249596 2013-04-17 22:42:43Z ken "); */
-__RCSID("$NetBSD: nfs_nfsdkrpc.c,v 1.1.1.1 2013/09/30 07:19:53 dholland Exp $");
+__RCSID("$NetBSD: nfs_nfsdkrpc.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
 
 #include "opt_inet6.h"
 #include "opt_kgssapi.h"
@@ -179,7 +179,7 @@
 #if defined(KLD_MODULE)
                        /* Do not use ip6_sprintf: the nfs module should work without INET6. */
 #define        ip6_sprintf(buf, a)                                             \
-                       (sprintf((buf), "%x:%x:%x:%x:%x:%x:%x:%x",      \
+                       (snprintf((buf), sizeof(buf), "%x:%x:%x:%x:%x:%x:%x:%x",        \
                            (a)->s6_addr16[0], (a)->s6_addr16[1],       \
                            (a)->s6_addr16[2], (a)->s6_addr16[3],       \
                            (a)->s6_addr16[4], (a)->s6_addr16[5],       \
diff -r 6b6e5d727944 -r e38a02ff58a6 sys/fs/nfs/server/nfs_nfsdserv.c
--- a/sys/fs/nfs/server/nfs_nfsdserv.c  Tue Mar 25 16:28:15 2014 +0000
+++ b/sys/fs/nfs/server/nfs_nfsdserv.c  Tue Mar 25 16:30:28 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_nfsdserv.c,v 1.1.1.1 2013/09/30 07:19:55 dholland Exp $    */
+/*     $NetBSD: nfs_nfsdserv.c,v 1.2 2014/03/25 16:30:28 christos Exp $        */
 /*-
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("FreeBSD: head/sys/fs/nfsserver/nfs_nfsdserv.c 245613 2013-01-18 19:42:08Z delphij "); */
-__RCSID("$NetBSD: nfs_nfsdserv.c,v 1.1.1.1 2013/09/30 07:19:55 dholland Exp $");
+__RCSID("$NetBSD: nfs_nfsdserv.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
 
 /*
  * nfs version 2, 3 and 4 server calls to vnode ops
@@ -3346,8 +3346,8 @@
                rad = NFSSOCKADDR(clp->lc_req.nr_nam, struct sockaddr_in *);
                ucp = (u_char *)&rad->sin_addr.s_addr;
                ucp2 = (u_char *)&rad->sin_port;
-               sprintf(addrbuf, "%d.%d.%d.%d.%d.%d", ucp[0] & 0xff,
-                   ucp[1] & 0xff, ucp[2] & 0xff, ucp[3] & 0xff,
+               snprintf(addrbuf, sizeof(addrbuf), "%d.%d.%d.%d.%d.%d",
+                   ucp[0] & 0xff, ucp[1] & 0xff, ucp[2] & 0xff, ucp[3] & 0xff,
                    ucp2[0] & 0xff, ucp2[1] & 0xff);
                (void) nfsm_strtom(nd, addrbuf, strlen(addrbuf));
        }



Home | Main Index | Thread Index | Old Index