Add validity check to detect invalid PDUs.
Test: manual Bug: 181382933 Change-Id: I32cdca12c279bf0514a8b7d102d5b4b6b0d76314
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user