diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-09-10 15:38:48 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-09-10 15:38:48 +0900 |
commit | d4334b3ee7ce4f5c736d3bda979388a87ba7aef3 (patch) | |
tree | bd59cecbc982f93ef4a237bd81f1b9cfd0cb10c7 /ext/repo_rpmdb.c | |
parent | 79b3a6b7ab494c5ff10e740fd147f21a04907907 (diff) | |
download | libsolv-d4334b3ee7ce4f5c736d3bda979388a87ba7aef3.tar.gz libsolv-d4334b3ee7ce4f5c736d3bda979388a87ba7aef3.tar.bz2 libsolv-d4334b3ee7ce4f5c736d3bda979388a87ba7aef3.zip |
Imported Upstream version 0.7.3upstream/0.7.3
Diffstat (limited to 'ext/repo_rpmdb.c')
-rw-r--r-- | ext/repo_rpmdb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 9acb400..326c5aa 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -1896,6 +1896,8 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (fread(lead, 96 + 16, 1, fp) != 1 || getu32(lead) != 0xedabeedb) { pool_error(pool, -1, "%s: not a rpm", rpm); + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1908,12 +1910,16 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (lead[78] != 0 || lead[79] != 5) { pool_error(pool, -1, "%s: not a rpm v5 header", rpm); + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } if (getu32(lead + 96) != 0x8eade801) { pool_error(pool, -1, "%s: bad signature header", rpm); + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1922,6 +1928,8 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (sigcnt >= MAX_SIG_CNT || sigdsize >= MAX_SIG_DSIZE) { pool_error(pool, -1, "%s: bad signature header", rpm); + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1932,6 +1940,8 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) { if (!headfromfp(&state, rpm, fp, lead + 96, sigcnt, sigdsize, sigpad, chksumh, leadsigchksumh)) { + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1971,6 +1981,8 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (fread(lead, l, 1, fp) != 1) { pool_error(pool, -1, "%s: unexpected EOF", rpm); + solv_chksum_free(leadsigchksumh, 0); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1991,6 +2003,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (fread(lead, 16, 1, fp) != 1) { pool_error(pool, -1, "%s: unexpected EOF", rpm); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -1999,6 +2012,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (getu32(lead) != 0x8eade801) { pool_error(pool, -1, "%s: bad header", rpm); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -2007,6 +2021,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (sigcnt >= MAX_HDR_CNT || sigdsize >= MAX_HDR_DSIZE) { pool_error(pool, -1, "%s: bad header", rpm); + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } @@ -2014,6 +2029,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) if (!headfromfp(&state, rpm, fp, lead, sigcnt, sigdsize, 0, chksumh, 0)) { + solv_chksum_free(chksumh, 0); fclose(fp); return 0; } |