mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
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
This commit is contained in:
parent
c98cd9bdb6
commit
686ad32164
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user