summaryrefslogtreecommitdiff
path: root/src/app_adbsign.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-07-21 16:13:39 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-07-22 16:14:49 +0300
commit2f1186aa404ea86eb53ad89ec2df315e607f90aa (patch)
tree1de8e1399ce6a070a5f6b3067d11c884c161c506 /src/app_adbsign.c
parent05364528bbb5e1300187da3c3df474b9eaee2138 (diff)
downloadapk-tools-2f1186aa404ea86eb53ad89ec2df315e607f90aa.tar.gz
apk-tools-2f1186aa404ea86eb53ad89ec2df315e607f90aa.tar.bz2
apk-tools-2f1186aa404ea86eb53ad89ec2df315e607f90aa.tar.xz
apk-tools-2f1186aa404ea86eb53ad89ec2df315e607f90aa.zip
adb: make adb mmap/stream parser more united, add ADB_BLOCK_DATAX
Harden the error checking of expected block types and their order. Add ADB_BLOCK_DATAX as reserved for >1GB blocks.
Diffstat (limited to 'src/app_adbsign.c')
-rw-r--r--src/app_adbsign.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/app_adbsign.c b/src/app_adbsign.c
index 82604cd..d903c60 100644
--- a/src/app_adbsign.c
+++ b/src/app_adbsign.c
@@ -84,10 +84,11 @@ static int adbsign_main(void *pctx, struct apk_ctx *ac, struct apk_string_array
ctx->ac = ac;
foreach_array_item(arg, args) {
+ memset(&ctx->vfy, 0, sizeof ctx->vfy);
struct apk_istream *is = adb_decompress(apk_istream_from_file_mmap(AT_FDCWD, *arg), &comp);
ctx->os = adb_compress(apk_ostream_to_file(AT_FDCWD, *arg, 0644), comp);
- adb_m_process(&ctx->db, is, 0, 0, process_block);
- process_signatures(ctx);
+ apk_ostream_cancel(ctx->os, adb_m_process(&ctx->db, is, 0, 0, process_block));
+ apk_ostream_cancel(ctx->os, process_signatures(ctx));
adb_free(&ctx->db);
r = apk_ostream_close(ctx->os);
if (r) apk_err(out, "%s: %s", *arg, apk_error_str(r));