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

Commit 30d42178 authored by Mengjun Leng's avatar Mengjun Leng
Browse files

Fix wrong reading the sms lengh of stored long sms in RUIM

According to 3GGP2 C.S0023 3.4.27, the maximum length of the message
is 255. For one byte casts to int, the result will be a negative value
when larger than 127, so must use 0xFF to transfer byte to int first.

Change-Id: Ia3d64cae91f12a46ef7a1602300b44209a353966
parent 36fdb346
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public class SmsMessage extends SmsMessageBase {

            // Second byte is the MSG_LEN, length of the message
            // See 3GPP2 C.S0023 3.4.27
            int size = data[1];
            int size = data[1] & 0xFF;

            // Note: Data may include trailing FF's.  That's OK; message
            // should still parse correctly.