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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user