ath: fix possible memory disclosures in ioctl handlers
Apply the fix from r327499 to additional ioctl handlers. Reported by: Ilja van Sprundel <ivansprundel@ioactive.com> MFC after: 1 week MFC with: r327499 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
9e20f9abb6
commit
60d6b01bb9
@ -189,7 +189,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_diag *ad)
|
||||
* pointer for us to use below in reclaiming the buffer;
|
||||
* 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) {
|
||||
error = ENOMEM;
|
||||
goto bad;
|
||||
@ -198,6 +198,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_diag *ad)
|
||||
switch (id) {
|
||||
default:
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
if (outsize < ad->ad_out_size)
|
||||
ad->ad_out_size = outsize;
|
||||
|
@ -219,7 +219,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_diag *ad)
|
||||
* pointer for us to use below in reclaiming the buffer;
|
||||
* 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) {
|
||||
error = ENOMEM;
|
||||
goto bad;
|
||||
@ -282,6 +282,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_diag *ad)
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
if (outsize < ad->ad_out_size)
|
||||
ad->ad_out_size = outsize;
|
||||
|
Loading…
Reference in New Issue
Block a user