summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2016-11-16 07:02:48 +0000
committerratchov <ratchov@openbsd.org>2016-11-16 07:02:48 +0000
commitbac8e5e5f2fc519c3564bd699d29481eb12c6d88 (patch)
tree76a2900a6eff296e9cf9e33377e3162a992b31ea /sys
parentrework re_start and re_txeof to be more like other drivers. (diff)
downloadwireguard-openbsd-bac8e5e5f2fc519c3564bd699d29481eb12c6d88.tar.xz
wireguard-openbsd-bac8e5e5f2fc519c3564bd699d29481eb12c6d88.zip
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')
-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;