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:22:52 +0300
commit217a996f25a8d3931c97be631a64625b6dd10fe0 (patch)
treebb977178f740a50f108cb97335d2795b0d175a63
parentfa660524026ecef686bb317cdc937008ae729de4 (diff)
downloadlibrpm-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.c2
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;
/*