Skip to content

Commit

Permalink
ath5k: fix buffer overrun in rate debug code
Browse files Browse the repository at this point in the history
char bname[5] is too small for the string "X GHz" when the null
terminator is taken into account.  Thus, turning on rate debugging
can crash unless we have lucky stack alignment.

Cc: stable@kernel.org
Reported-by: Paride Legovini <legovini@spiro.fisica.unipd.it>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Apr 28, 2009
1 parent 74aa9be commit b7fcb5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath5k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc)

for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
struct ieee80211_supported_band *band = &sc->sbands[b];
char bname[5];
char bname[6];
switch (band->band) {
case IEEE80211_BAND_2GHZ:
strcpy(bname, "2 GHz");
Expand Down

0 comments on commit b7fcb5c

Please sign in to comment.