Fix for NPE on empty MMS PDU

This commit is contained in:
Moxie Marlinspike 2013-01-01 12:54:12 -08:00
parent 62cad05acb
commit b805c4db4e

View File

@ -71,13 +71,13 @@ public class MmsDownloader extends MmscProcessor {
getApnInformation()); getApnInformation());
RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse(); RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();
for (int i=0;i<retrieved.getBody().getPartsNum();i++) {
Log.w("MmsDownloader", "Sent MMS part of content-type: " + new String(retrieved.getBody().getPart(i).getContentType()));
}
if (retrieved == null) if (retrieved == null)
throw new IOException("Bad retrieved PDU"); throw new IOException("Bad retrieved PDU");
for (int i=0;i<retrieved.getBody().getPartsNum();i++) {
Log.w("MmsDownloader", "Sent MMS part of content-type: " +
new String(retrieved.getBody().getPart(i).getContentType()));
}
if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) { if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
long messageId = mmsDatabase.insertSecureMessageReceived(retrieved, item.getContentLocation(), item.getThreadId()); long messageId = mmsDatabase.insertSecureMessageReceived(retrieved, item.getContentLocation(), item.getThreadId());
@ -177,6 +177,4 @@ public class MmsDownloader extends MmscProcessor {
protected String getConnectivityAction() { protected String getConnectivityAction() {
return SendReceiveService.DOWNLOAD_MMS_CONNECTIVITY_ACTION; return SendReceiveService.DOWNLOAD_MMS_CONNECTIVITY_ACTION;
} }
} }