From b805c4db4e28ec98e7783252187e441c4c75eba5 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 1 Jan 2013 12:54:12 -0800 Subject: [PATCH] Fix for NPE on empty MMS PDU --- .../securesms/service/MmsDownloader.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/org/thoughtcrime/securesms/service/MmsDownloader.java b/src/org/thoughtcrime/securesms/service/MmsDownloader.java index 85fe78463d..ef9981ed78 100644 --- a/src/org/thoughtcrime/securesms/service/MmsDownloader.java +++ b/src/org/thoughtcrime/securesms/service/MmsDownloader.java @@ -71,20 +71,20 @@ public class MmsDownloader extends MmscProcessor { getApnInformation()); RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse(); + if (retrieved == null) + throw new IOException("Bad retrieved PDU"); + for (int i=0;i