summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-08-02 12:22:52 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-08-02 12:51:14 +0300
commitb73ab3aa31205d111fabdb0bbe1103c0d292d018 (patch)
tree9137a0331bdc9900a2fe6a7b9444548728de603b
parent53135a99bfd53abb7a37e23c064f4412cae91471 (diff)
downloadrpm-b73ab3aa31205d111fabdb0bbe1103c0d292d018.tar.gz
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. (cherry picked from commit 217a996f25a8d3931c97be631a64625b6dd10fe0)
-rw-r--r--rpmio/rpmpgp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 04472deb7..f46ab2f10 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -1399,7 +1399,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;
/*