Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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++) {