diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-07-25 08:52:43 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-07-25 08:52:43 +0300 |
commit | c1405f9311a1789727c14858e1bb770965fa03ff (patch) | |
tree | aec26ee474d5c3d95d68b058195e0aae628542f1 /src/adb.c | |
parent | 3d203e8f5f35cd5e34c3d0b80ebdcc7d8d33bee7 (diff) | |
download | apk-tools-c1405f9311a1789727c14858e1bb770965fa03ff.tar.gz apk-tools-c1405f9311a1789727c14858e1bb770965fa03ff.tar.bz2 apk-tools-c1405f9311a1789727c14858e1bb770965fa03ff.tar.xz apk-tools-c1405f9311a1789727c14858e1bb770965fa03ff.zip |
adb: fix error handling of non-adb files
Diffstat (limited to 'src/adb.c')
-rw-r--r-- | src/adb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -257,7 +257,10 @@ err: int adb_m_process(struct adb *db, struct apk_istream *is, uint32_t expected_schema, struct apk_trust *t, int (*cb)(struct adb *, struct adb_block *, struct apk_istream *)) { - apk_blob_t mmap = apk_istream_mmap(is); + apk_blob_t mmap; + + if (IS_ERR(is)) return PTR_ERR(is); + mmap = apk_istream_mmap(is); memset(db, 0, sizeof *db); if (expected_schema & ADB_SCHEMA_IMPLIED) db->schema = expected_schema & ~ADB_SCHEMA_IMPLIED; |