diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-10-20 22:20:33 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-10-20 22:25:12 +0300 |
commit | 3218c2cfc931535e9bb415b1b8c8cbe719c62cfe (patch) | |
tree | ea57c56d34038e610b7bece647eb9a8c35cf0004 | |
parent | d109b10edcafd2d152a6ae474a7d2ce78e97845f (diff) |
If pk is NULL, the backend would segfault when accessing ->algo and the
following NULL check was never reached.
This problem was found by Coccinelle (null_ref.cocci from coccicheck).
Marti Raudsepp
-rw-r--r-- | contrib/pgcrypto/pgp-pubenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/pgcrypto/pgp-pubenc.c b/contrib/pgcrypto/pgp-pubenc.c index de729476f59..7db6ce1ee9d 100644 --- a/contrib/pgcrypto/pgp-pubenc.c +++ b/contrib/pgcrypto/pgp-pubenc.c @@ -199,7 +199,7 @@ pgp_write_pubenc_sesskey(PGP_Context * ctx, PushFilter * dst) PGP_PubKey *pk = ctx->pub_key; uint8 ver = 3; PushFilter *pkt = NULL; - uint8 algo = pk->algo; + uint8 algo; if (pk == NULL) { @@ -207,6 +207,8 @@ pgp_write_pubenc_sesskey(PGP_Context * ctx, PushFilter * dst) return PXE_BUG; } + algo = pk->algo; + /* * now write packet */ |