summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-09-25 22:32:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-09-25 22:32:28 +0000
commit3c04fb58cdb2f42a58d9c7295bf7739842e157f3 (patch)
tree4aabb297b8bfcb53bd2dddc8b6a71c1995b207b6
parent0cdb78eb81f90019f1445b90d4b54bc483424500 (diff)
make sure to not overflow when initializing {node,net}name (truncation does not matter)
-rw-r--r--sys/dev/ic/an.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c
index 63dab9a8375..d0f5ef5c2be 100644
--- a/sys/dev/ic/an.c
+++ b/sys/dev/ic/an.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: an.c,v 1.30 2003/09/23 11:13:20 avsm Exp $ */
+/* $OpenBSD: an.c,v 1.31 2003/09/25 22:32:27 mickey Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -241,13 +241,13 @@ an_attach(sc)
IFQ_SET_READY(&ifp->if_snd);
bzero(sc->an_config.an_nodename, sizeof(sc->an_config.an_nodename));
- bcopy(AN_DEFAULT_NODENAME, sc->an_config.an_nodename,
- sizeof(AN_DEFAULT_NODENAME) - 1);
+ strlcpy(sc->an_config.an_nodename, AN_DEFAULT_NODENAME,
+ sizeof(sc->an_config.an_nodename));
bzero(sc->an_ssidlist.an_ssid1, sizeof(sc->an_ssidlist.an_ssid1));
- bcopy(AN_DEFAULT_NETNAME, sc->an_ssidlist.an_ssid1,
- sizeof(AN_DEFAULT_NETNAME) - 1);
- sc->an_ssidlist.an_ssid1_len = strlen(AN_DEFAULT_NETNAME);
+ strlcpy(sc->an_ssidlist.an_ssid1, AN_DEFAULT_NETNAME,
+ sizeof(sc->an_ssidlist.an_ssid1));
+ sc->an_ssidlist.an_ssid1_len = strlen(sc->an_ssidlist.an_ssid1);
sc->an_config.an_opmode = AN_OPMODE_INFRASTRUCTURE_STATION;