diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-08-02 12:22:52 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-08-02 12:22:52 +0300 |
commit | 217a996f25a8d3931c97be631a64625b6dd10fe0 (patch) | |
tree | bb977178f740a50f108cb97335d2795b0d175a63 | |
parent | fa660524026ecef686bb317cdc937008ae729de4 (diff) | |
download | librpm-tizen-217a996f25a8d3931c97be631a64625b6dd10fe0.tar.gz librpm-tizen-217a996f25a8d3931c97be631a64625b6dd10fe0.tar.bz2 librpm-tizen-217a996f25a8d3931c97be631a64625b6dd10fe0.zip |
pgpVerifySig() check of NULL hash is the wrong way around
- NULL hash is pretty much a can't happen-case here but lets be
sane if it happens afterall - NULL hash would be an error and
we dont want to process the rest if that happened.
-rw-r--r-- | rpmio/rpmpgp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index cf2ebf048..28ae48f81 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -1396,7 +1396,7 @@ rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx) rpmDigestFinal(ctx, (void **)&hash, &hashlen, 0); /* Compare leading 16 bits of digest for quick check. */ - if (hash && memcmp(hash, sigp->signhash16, 2) != 0) + if (hash == NULL || memcmp(hash, sigp->signhash16, 2) != 0) goto exit; /* |