summaryrefslogtreecommitdiffstats
path: root/telephony/java/com
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-17 10:21:11 -0800
committerKenny Root <kroot@google.com>2010-02-17 10:21:11 -0800
commita409128a7238b7b7a2b38f8b3732ca8905b89c71 (patch)
tree9cc2b572cf3a7312f4abe9bf521506db35096cc7 /telephony/java/com
parenta4437fc93a993c7ab326b592d22c05be2f11b543 (diff)
downloadframeworks_base-a409128a7238b7b7a2b38f8b3732ca8905b89c71.zip
frameworks_base-a409128a7238b7b7a2b38f8b3732ca8905b89c71.tar.gz
frameworks_base-a409128a7238b7b7a2b38f8b3732ca8905b89c71.tar.bz2
Prevent sign extension in UsimPhoneBookManager
When performing a logical OR on a byte value, make sure to truncate its value to prevent possible sign extension when it is converted to 32-bit. Change-Id: I7bdfded32cec3e8a5f6b5c45316b2af5ab9471d1
Diffstat (limited to 'telephony/java/com')
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java b/telephony/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
index 9caae3d..41e527c 100644
--- a/telephony/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
+++ b/telephony/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
@@ -409,7 +409,7 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {
case USIM_EFIAP_TAG:
case USIM_EFSNE_TAG:
data = tlv.getData();
- int efid = data[0] << 8 | data[1];
+ int efid = ((data[0] & 0xFF) << 8) | (data[1] & 0xFF);
val.put(tag, efid);
break;
}