Skip to content

Commit

Permalink
libertas: Read buffer overflow
Browse files Browse the repository at this point in the history
Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Roel Kluin authored and John W. Linville committed Aug 3, 2009
1 parent 9f9857b commit b929c63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/11d.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region)
{
u8 i;

for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++)
for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++)
region[i] = toupper(region[i]);

for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
Expand Down

0 comments on commit b929c63

Please sign in to comment.