Commit b929c633 authored by Roel Kluin's avatar Roel Kluin Committed by John W. Linville

libertas: Read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9f9857bb
...@@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region) ...@@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region)
{ {
u8 i; 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]); region[i] = toupper(region[i]);
for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment