Re: [PATCH] Fix NULL dereference in show_sig_summary().

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aeR57mnzSNJ3jTSJ@devuan>
On 2026-04-19T13:48:35+0800, Kevin J. McCarthy wrote:
> Inside show_one_sig_status(), if the error code is GPG_ERR_NO_PUBKEY,
> key is NULL.  However, show_sig_summary() doesn't check for a NULL key
> before dereferencing for the "key expired" case.
> 
> Thanks to [email protected] for the security report.
> 
> Thanks to Alejandro Colomar for his review and suggestion to keep the
> ternary operator.

Reviewed-by: Alejandro Colomar <[email protected]>

> ---
> This is 1 in the list evilrabbit sent.
> 
>  crypt-gpgme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypt-gpgme.c b/crypt-gpgme.c
> index 5313d6f2..b30632b8 100644
> --- a/crypt-gpgme.c
> +++ b/crypt-gpgme.c
> @@ -1425,7 +1425,7 @@ static int show_sig_summary (unsigned long sum,
>  
>    if ((sum & GPGME_SIGSUM_KEY_EXPIRED))
>      {
> -      time_t at = key->subkeys->expires ? key->subkeys->expires : 0;
> +      time_t at = (key && key->subkeys) ? key->subkeys->expires : 0;
>        if (at)
>          {
>            state_puts (_("Warning: The key used to create the "
> -- 
> 2.53.0
> 

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmnkegAACgkQ64mZXMKQ
wqk3ng/8DqhnkR1q2Q86UoMYNjwfGxHbTPCkpgsBo/0frgNjr1lY8u3jw8lAdM4O
4r9wPZ1NFxRbz7bavJfpbFuHGSpWdj8gAg4+guJBwkIz10MGRlcXiEsV0qqkAVgK
MHdK6TABAQvobUM4cm7TXooQYfAFgM4itKjppUNjWwZUKZumAsZef39Gmvq2ps8r
SWkT2SbEUYWB01sL5rALDWuB4ANwknPzAKuUDDbCOfhuc3+hsIlct7ZAUrj4s0mX
Gb67cR11d0Fv1VyHqtmG9NVbxBMs/vbz/4HIcInpQ30LQKDve6NicqyNiPB48WSr
8Wl39eks4SY2phOfWqk/rTY+pCM5peyV7+BS8VxMX+h6UJo65oiLtxUcDBm775Pz
VFzkBWXEWrN5bCRSkHCw6wXESeDLi6Mv8GyjFLmKQKiUq8lHTp40jTRxg01XtxoH
5W4k2aKoWukBpNsfaLPPkIulzZqm/awryVCCvV6268zgpltzBD2Z33UWEKp2PDcX
FKNaAaBHPR1QitO3IXHVfNU9sgUa31TfG9lC12e1Gst/NjL71JD4i9zcj7FOojbr
8eCOiGT3GKzabOZtOenG44965QmgtAPqyHfP0P/X21P7idi0Btkpz8IS+o+AtnJt
ofD7fSm5DaUATBM0n45YI/h5BUMmc/nxGt06eN2Yg384Pa3N8kI=
=uSHu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.