Check for NPE when bad data is passed to the PDUParser.

fork-5.53.8
Alex Hart 2021-10-05 11:30:01 -03:00 zatwierdzone przez GitHub
rodzic ff76c5fca5
commit c225c2b37d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -126,7 +126,14 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
Bundle configValues = smsManager.getCarrierConfigValues();
boolean parseContentDisposition = configValues.getBoolean(SmsManager.MMS_CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION);
RetrieveConf retrieved = (RetrieveConf) new PduParser(baos.toByteArray(), parseContentDisposition).parse();
RetrieveConf retrieved;
try {
retrieved = (RetrieveConf) new PduParser(baos.toByteArray(), parseContentDisposition).parse();
} catch (NullPointerException e) {
Log.w(TAG, "Badly formatted MMS message caused the parser to fail.", e);
throw new MmsException(e);
}
if (retrieved == null) return null;