ath: fix possible memory disclosure in ioctl handler

Submitted by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after:	1 week
This commit is contained in:
emaste 2018-01-03 19:28:13 +00:00
parent ecc16fc696
commit fab115e4cc

View File

@ -197,7 +197,7 @@ ath_ioctl_diag(struct ath_softc *sc, struct ath_diag *ad)
* pointer for us to use below in reclaiming the buffer; * pointer for us to use below in reclaiming the buffer;
* may want to be more defensive. * may want to be more defensive.
*/ */
outdata = malloc(outsize, M_TEMP, M_NOWAIT); outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO);
if (outdata == NULL) { if (outdata == NULL) {
error = ENOMEM; error = ENOMEM;
goto bad; goto bad;