summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-11-16 07:02:49 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-11-16 07:02:49 +0000
commit2eb539712fa5a8fbe0e846d69f7bb63da5be730d (patch)
tree04e54cacefb9ee52fb2a5ae1d65845209129b5fb /sys/dev
parentf279ce3c8bc44ec027b3296ec968cd4dad72e6ef (diff)
Use memcpy() to copy structures into freshly malloc'ated buffers,
as source and destination never overlap in this case. From Michael W. Bombardieri <mb at ii.net>.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uaudio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index 68127184d4e..cbec23e8c2d 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.118 2016/11/08 06:09:56 ratchov Exp $ */
+/* $OpenBSD: uaudio.c,v 1.119 2016/11/16 07:02:48 ratchov Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
@@ -622,7 +622,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc)
/* Copy old data, if there was any */
if (sc->sc_nctls != 0) {
- bcopy(sc->sc_ctls, nmc, sizeof(*mc) * (sc->sc_nctls));
+ memcpy(nmc, sc->sc_ctls, sizeof(*mc) * (sc->sc_nctls));
free(sc->sc_ctls, M_USBDEV, 0);
}
sc->sc_ctls = nmc;
@@ -1501,7 +1501,7 @@ uaudio_add_alt(struct uaudio_softc *sc, const struct as_info *ai)
/* Copy old data, if there was any */
if (sc->sc_nalts != 0) {
- bcopy(sc->sc_alts, nai, sizeof(*ai) * (sc->sc_nalts));
+ memcpy(nai, sc->sc_alts, sizeof(*ai) * (sc->sc_nalts));
free(sc->sc_alts, M_USBDEV, 0);
}
sc->sc_alts = nai;