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

Commit 3f548cb6 authored by sy.yun's avatar sy.yun Committed by elektroschmock
Browse files

fix mvno_match_data OutOfBounds Exception in substring check routine.

When the length of mvno_match_data is greater than GID from IccRecord,
It will generate StringIndexOutOfBoundsException.
Therefore, codes are changed to use startsWith() insteads of subString().

Change-Id: I04c5c5039edb2cfa757bf2f5a4b9f124afb69b06
Bugs: 10171336

Fix mvnoMatches function but keep case-insensitive

Redo previous fix in a way that's still case insensitive.

bug:10171336
Change-Id: I65e29b72ace2a41ed7a19e3bfb5d23bf3773d41c
parent cd964150
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -952,8 +952,9 @@ public final class DcTracker extends DcTrackerBase {
            }
        } else if (mvno_type.equalsIgnoreCase("gid")) {
            String gid1 = r.getGid1();
            if ((gid1 != null) && gid1.substring(0,
                    mvno_match_data.length()).equalsIgnoreCase(mvno_match_data)) {
            int mvno_match_data_length = mvno_match_data.length();
            if ((gid1 != null) && (gid1.length() >= mvno_match_data_length) &&
                    gid1.substring(0, mvno_match_data_length).equalsIgnoreCase(mvno_match_data)) {
                return true;
            }
        }