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

Commit a3d2d769 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

GpsStatus: Bounds check PRN to avoid array indexing exceptions.



Change-Id: Iea8b525dd8681f32cb7ce7415dad0ec665d9016d
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 04598b67
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