1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-10 17:57:40 +03:00

Merge pull request #19676 from bluca/coverity

Fix two new coverity issues
This commit is contained in:
Lennart Poettering 2021-05-21 17:52:36 +02:00 committed by GitHub
commit a6383f1e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -206,6 +206,9 @@ int journal_directory_vacuum(
} else if (endswith(de->d_name, ".journal~")) {
unsigned long long tmp;
/* seqnum_id won't be initialised before use below, so set to 0 */
seqnum_id = SD_ID128_NULL;
/* Vacuum corrupted files */
if (q < 1 + 16 + 1 + 16 + 8 + 1) {

View File

@ -805,7 +805,9 @@ int dnssec_verify_rrset(
case DNSSEC_ALGORITHM_ED448:
*result = DNSSEC_UNSUPPORTED_ALGORITHM;
return 0;
default:
default: {
gcry_error_t err;
/* OK, the RRs are now in canonical order. Let's calculate the digest */
md_algorithm = algorithm_to_gcrypt_md(rrsig->rrsig.algorithm);
if (md_algorithm == -EOPNOTSUPP) {
@ -815,8 +817,8 @@ int dnssec_verify_rrset(
if (md_algorithm < 0)
return md_algorithm;
gcry_md_open(&md, md_algorithm, 0);
if (!md)
err = gcry_md_open(&md, md_algorithm, 0);
if (gcry_err_code(err) != GPG_ERR_NO_ERROR || !md)
return -EIO;
hash_size = gcry_md_get_algo_dlen(md_algorithm);
@ -828,6 +830,7 @@ int dnssec_verify_rrset(
if (!hash)
return -EIO;
}
}
switch (rrsig->rrsig.algorithm) {