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

Lines changed: 3 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy