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

Commit 89bdbc98 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am a3d2d769: GpsStatus: Bounds check PRN to avoid array indexing exceptions.

parents f1307b2a a3d2d769
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ public final class GpsStatus {
        for (i = 0; i < svCount; i++) {
            int prn = prns[i] - 1;
            int prnShift = (1 << prn);
            if (prn >= 0 && prn < mSatellites.length) {
                GpsSatellite satellite = mSatellites[prn];
    
                satellite.mValid = true;
@@ -161,6 +162,7 @@ public final class GpsStatus {
                satellite.mUsedInFix = ((usedInFixMask & prnShift) != 0);
            }
        }
    }

    /**
     * Used by {@link LocationManager#getGpsStatus} to copy LocationManager's