summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2007-12-05 19:32:07 +0000
committerphilip <philip@FreeBSD.org>2007-12-05 19:32:07 +0000
commitc2ee5917b0914026950465c0d4da515901da2989 (patch)
tree863e2e88958998a6e8c22156fd6e6f5e25c85a2c /sys/dev/iwi
parent2271bb9685541401cad85f84d1a3260c2051a516 (diff)
downloadFreeBSD-src-c2ee5917b0914026950465c0d4da515901da2989.zip
FreeBSD-src-c2ee5917b0914026950465c0d4da515901da2989.tar.gz
Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size. Submitted by: Ilja van Sprundel <ilja -at- netric.org> Reviewed by: secteam MFC after: 1 day
Diffstat (limited to 'sys/dev/iwi')
-rw-r--r--sys/dev/iwi/if_iwi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index f4572d3..97dad68 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -3327,15 +3327,15 @@ iwi_sysctl_stats(SYSCTL_HANDLER_ARGS)
struct iwi_softc *sc = arg1;
uint32_t size, buf[128];
- if (!(sc->flags & IWI_FLAG_FW_INITED)) {
- memset(buf, 0, sizeof buf);
+ memset(buf, 0, sizeof buf);
+
+ if (!(sc->flags & IWI_FLAG_FW_INITED))
return SYSCTL_OUT(req, buf, sizeof buf);
- }
size = min(CSR_READ_4(sc, IWI_CSR_TABLE0_SIZE), 128 - 1);
CSR_READ_REGION_4(sc, IWI_CSR_TABLE0_BASE, &buf[1], size);
- return SYSCTL_OUT(req, buf, sizeof buf);
+ return SYSCTL_OUT(req, buf, size);
}
static int
OpenPOWER on IntegriCloud