diff options
author | Timo Teräs <timo.teras@iki.fi> | 2022-01-17 10:55:37 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2022-01-17 10:55:37 +0200 |
commit | a2cd188039231e1cb8d218e75970900bb4a9ae22 (patch) | |
tree | 548763379211b5d7e09739becc8bb195f52b9df9 /src/database.c | |
parent | e8650d4d44d32a3a605283d921e535fff3a17089 (diff) | |
download | apk-tools-a2cd188039231e1cb8d218e75970900bb4a9ae22.tar.gz apk-tools-a2cd188039231e1cb8d218e75970900bb4a9ae22.tar.bz2 apk-tools-a2cd188039231e1cb8d218e75970900bb4a9ae22.tar.xz apk-tools-a2cd188039231e1cb8d218e75970900bb4a9ae22.zip |
package: fail on invalid control data
Handle meta data error to produce hard failure.
fixes #10806
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c index f5d3f0f..6b48bb8 100644 --- a/src/database.c +++ b/src/database.c @@ -2398,8 +2398,13 @@ static int apk_db_install_v2meta(struct apk_extract_ctx *ectx, struct apk_istrea { struct install_ctx *ctx = container_of(ectx, struct install_ctx, ectx); apk_blob_t l, token = APK_BLOB_STR("\n"); - while (apk_istream_get_delim(is, token, &l) == 0) - read_info_line(ctx, l); + int r; + + while (apk_istream_get_delim(is, token, &l) == 0) { + r = read_info_line(ctx, l); + if (r < 0) return r; + } + return 0; } |