summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2019-01-12 16:12:10 +0000
committerstsp <stsp@openbsd.org>2019-01-12 16:12:10 +0000
commit5b6e5399f66b3c63786b163e9e89733e76f7602c (patch)
tree87f0d6fe3e7e6dd40b8c08794e163e988f1eefe1
parentMake the scan loop in otus(4) terminate properly when the interface (diff)
downloadwireguard-openbsd-5b6e5399f66b3c63786b163e9e89733e76f7602c.tar.xz
wireguard-openbsd-5b6e5399f66b3c63786b163e9e89733e76f7602c.zip
Fix potential use-after-free if xfer allocation fails when otus(4) attaches.
ok mpi@ ian@
-rw-r--r--sys/dev/usb/if_otus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index 86adec9cfce..a136d5eec76 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.61 2019/01/12 16:11:22 stsp Exp $ */
+/* $OpenBSD: if_otus.c,v 1.62 2019/01/12 16:12:10 stsp Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -582,6 +582,7 @@ otus_alloc_tx_cmd(struct otus_softc *sc)
printf("%s: could not allocate xfer buffer\n",
sc->sc_dev.dv_xname);
usbd_free_xfer(cmd->xfer);
+ cmd->xfer = NULL;
return ENOMEM;
}
return 0;