From c07d04b2305655003d726cf50afbc7edf1746614 Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 1 Nov 2019 07:58:08 +0800 Subject: [PATCH] Fix issue #104, getApkV2Singers crash --- .../java/net/dongliu/apk/parser/parser/ApkSignBlockParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/dongliu/apk/parser/parser/ApkSignBlockParser.java b/src/main/java/net/dongliu/apk/parser/parser/ApkSignBlockParser.java index 9e73902..fca9361 100644 --- a/src/main/java/net/dongliu/apk/parser/parser/ApkSignBlockParser.java +++ b/src/main/java/net/dongliu/apk/parser/parser/ApkSignBlockParser.java @@ -32,7 +32,7 @@ public ApkSignBlockParser(ByteBuffer data) { public ApkSigningBlock parse() throws CertificateException { // sign block found, read pairs List signerBlocks = new ArrayList<>(); - while (data.hasRemaining()) { + while (data.remaining() >= 8) { int id = data.getInt(); int size = Unsigned.ensureUInt(data.getInt()); if (id == ApkSigningBlock.SIGNING_V2_ID) {