summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsh <jsh@google.com>2009-05-20 10:52:19 -0700
committerjsh <jsh@google.com>2009-05-20 12:55:25 -0700
commit31fd22923aaefc85652a5b5939c6d4aa6fa289e2 (patch)
treede5be9d0d278d89918b17dc3cd3fed0a330335b3
parenta5ca3425f9cbb930dc62559893590432ed29c961 (diff)
downloadframeworks_base-31fd22923aaefc85652a5b5939c6d4aa6fa289e2.zip
frameworks_base-31fd22923aaefc85652a5b5939c6d4aa6fa289e2.tar.gz
frameworks_base-31fd22923aaefc85652a5b5939c6d4aa6fa289e2.tar.bz2
Make sure smsHeader != null before using it.
Fixes bug 1866578 - NPE while trying to dispatch a non-concatenated SMS with no user data header (ie, your typical SMS).
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java2
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
index 2bb17e4..a3d00d7 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
@@ -138,7 +138,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
byte[][] pdus = new byte[1][];
pdus[0] = sms.getPdu();
- if (smsHeader.portAddrs != null) {
+ if (smsHeader != null && smsHeader.portAddrs != null) {
if (smsHeader.portAddrs.destPort == SmsHeader.PORT_WAP_PUSH) {
// GSM-style WAP indication
mWapPush.dispatchWapPdu(sms.getUserData());
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
index 2fce188..699142a 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
@@ -122,7 +122,7 @@ final class GsmSMSDispatcher extends SMSDispatcher {
byte[][] pdus = new byte[1][];
pdus[0] = sms.getPdu();
- if (smsHeader.portAddrs != null) {
+ if (smsHeader != null && smsHeader.portAddrs != null) {
if (smsHeader.portAddrs.destPort == SmsHeader.PORT_WAP_PUSH) {
mWapPush.dispatchWapPdu(sms.getUserData());
}