diff options
author | Amit Mahajan <amitmahajan@google.com> | 2021-05-12 17:19:20 -0700 |
---|---|---|
committer | Amit Mahajan <amitmahajan@google.com> | 2021-05-12 17:43:33 -0700 |
commit | 0445be53de644b49cb0504109bc5a8bd6b248420 (patch) | |
tree | bd90152afabf62fc93e76d2d78170f9dbcb542f1 /telephony/common | |
parent | ef36e9f960f801eab89be7a3cc839d8ca6f39261 (diff) |
Add validity check to detect invalid PDUs.
Test: manual
Bug: 181382933
Change-Id: I32cdca12c279bf0514a8b7d102d5b4b6b0d76314
Diffstat (limited to 'telephony/common')
-rwxr-xr-x | telephony/common/com/google/android/mms/pdu/PduParser.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/telephony/common/com/google/android/mms/pdu/PduParser.java b/telephony/common/com/google/android/mms/pdu/PduParser.java index 5340245ae869..677fe2f188a9 100755 --- a/telephony/common/com/google/android/mms/pdu/PduParser.java +++ b/telephony/common/com/google/android/mms/pdu/PduParser.java @@ -1550,6 +1550,11 @@ public class PduParser { if (cur < TEXT_MIN) { int length = parseValueLength(pduDataStream); int startPos = pduDataStream.available(); + if (length > startPos) { + Log.e(LOG_TAG, "parseContentType: Invalid length " + length + + " when available bytes are " + startPos); + return (PduContentTypes.contentTypes[0]).getBytes(); //"*/*" + } pduDataStream.mark(1); temp = pduDataStream.read(); assert(-1 != temp); |