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

Commit 6586ad9e authored by Jack Yu's avatar Jack Yu
Browse files

Fixed incorrect WAC decoding

Fixed the incorrect warning area coordinate decoding
when data length is greater than 127 bytes.

Bug: 143762197
Test: unit test
Change-Id: I498ccd0933f31898d531dcea307e160ae94653e8
parent cafc1388
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ public class GsmSmsCbMessage {
    private static Pair<Integer, List<Geometry>> parseWarningAreaCoordinates(
            byte[] pdu, int wacOffset) {
        // little-endian
        int wacDataLength = (pdu[wacOffset + 1] << 8) | pdu[wacOffset];
        int wacDataLength = ((pdu[wacOffset + 1] & 0xff) << 8) | (pdu[wacOffset] & 0xff);
        int offset = wacOffset + 2;

        if (offset + wacDataLength > pdu.length) {