Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 18e752f

Browse files
committed
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
1 parent def30e8 commit 18e752f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/pgcrypto/pgp-pubenc.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,16 @@ pgp_write_pubenc_sesskey(PGP_Context *ctx, PushFilter *dst)
199199
PGP_PubKey *pk = ctx->pub_key;
200200
uint8 ver = 3;
201201
PushFilter *pkt = NULL;
202-
uint8 algo = pk->algo;
202+
uint8 algo;
203203

204204
if (pk == NULL)
205205
{
206206
px_debug("no pubkey?\n");
207207
return PXE_BUG;
208208
}
209209

210+
algo = pk->algo;
211+
210212
/*
211213
* now write packet
212214
*/

0 commit comments

Comments
 (0)