Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ofw use safer string manipulation function



details:   https://anonhg.NetBSD.org/src/rev/945fc90c449f
branches:  trunk
changeset: 565938:945fc90c449f
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Apr 23 21:01:02 2004 +0000

description:
use safer string manipulation function

diffstat:

 sys/dev/ofw/ofdisk.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b4f461cf5464 -r 945fc90c449f sys/dev/ofw/ofdisk.c
--- a/sys/dev/ofw/ofdisk.c      Fri Apr 23 20:17:13 2004 +0000
+++ b/sys/dev/ofw/ofdisk.c      Fri Apr 23 21:01:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofdisk.c,v 1.27 2003/05/10 23:12:46 thorpej Exp $      */
+/*     $NetBSD: ofdisk.c,v 1.28 2004/04/23 21:01:02 itojun Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.27 2003/05/10 23:12:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.28 2004/04/23 21:01:02 itojun Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -134,7 +134,7 @@
        of->sc_ihandle = 0;
        of->sc_dk.dk_driver = &ofdisk_dkdriver;
        of->sc_dk.dk_name = of->sc_name;
-       strcpy(of->sc_name, of->sc_dev.dv_xname);
+       strlcpy(of->sc_name, of->sc_dev.dv_xname, sizeof(of->sc_name));
        disk_attach(&of->sc_dk);
        printf("\n");
 
@@ -175,7 +175,7 @@
                        path[l] = 0;
                }
 
-               strcat(path, ":0");
+               strlcat(path, ":0", sizeof(path));
 
                if ((of->sc_ihandle = OF_open(path)) == -1)
                        return ENXIO;



Home | Main Index | Thread Index | Old Index