fix: skip unknown chunks in AXML (#3237)

This commit is contained in:
Connor Tumbleson 2023-07-30 16:20:07 -04:00 committed by GitHub
parent 445da0e658
commit 663088890b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -713,7 +713,10 @@ public class AXmlResourceParser implements XmlResourceParser {
} }
if (chunkType < ARSCHeader.RES_XML_FIRST_CHUNK_TYPE || chunkType > ARSCHeader.RES_XML_LAST_CHUNK_TYPE) { if (chunkType < ARSCHeader.RES_XML_FIRST_CHUNK_TYPE || chunkType > ARSCHeader.RES_XML_LAST_CHUNK_TYPE) {
throw new IOException("Invalid chunk type (" + chunkType + ")."); int chunkSize = mIn.readInt();
mIn.skipBytes(chunkSize - 8);
LOGGER.warning(String.format("Unknown chunk type at: (0x%08x) skipping...", mCountIn.getCount()));
break;
} }
// Fake START_DOCUMENT event. // Fake START_DOCUMENT event.