check trust in adb_trust_write_signatures()

Based on patch from Daniel Golle <daniel@makrotopia.org>
cute-signatures
Timo Teräs 2021-07-15 16:37:26 +03:00
parent 34162d01fd
commit 2a25a595ce
1 changed files with 3 additions and 1 deletions

View File

@ -973,7 +973,7 @@ int adb_c_adb(struct apk_ostream *os, struct adb *db, struct apk_trust *t)
adb_c_header(os, db); adb_c_header(os, db);
adb_c_block(os, ADB_BLOCK_ADB, db->adb); adb_c_block(os, ADB_BLOCK_ADB, db->adb);
if (t) adb_trust_write_signatures(t, db, NULL, os); adb_trust_write_signatures(t, db, NULL, os);
return apk_ostream_error(os); return apk_ostream_error(os);
} }
@ -1032,6 +1032,8 @@ int adb_trust_write_signatures(struct apk_trust *trust, struct adb *db, struct a
size_t siglen; size_t siglen;
int r; int r;
if (IS_ERR_OR_NULL(trust)) return PTR_ERR(trust);
if (!vfy) { if (!vfy) {
vfy = alloca(sizeof *vfy); vfy = alloca(sizeof *vfy);
memset(vfy, 0, sizeof *vfy); memset(vfy, 0, sizeof *vfy);