Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f7a9d5b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add validity check to detect invalid PDUs." into sc-dev am: 54b18bd8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14523947

Change-Id: I179d081f56b0c52d10815eb27e9cdc65f130204d
parents 550c6bad 54b18bd8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);