From: Daniel Stenberg Date: Thu, 9 Jan 2025 07:31:32 +0000 (+0100) Subject: vtls_scache: fix possible null ptr deref X-Git-Tag: curl-8_12_0~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a19b759dea7c2e58f28f2ce3ec7d321299328c5b;p=thirdparty%2Fcurl.git vtls_scache: fix possible null ptr deref Pointed out by CodeSonar. It is probably not reachable, but might as well just add a precaution. Closes #15950 --- diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 937cb8c87e..9c04b77623 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -783,7 +783,7 @@ out: "quic_tp=%s], peer has %zu sessions now", ssl_peer_key, s->ietf_tls_id, s->valid_until - now, s->alpn, s->earlydata_max, s->quic_tp ? "yes" : "no", - Curl_llist_count(&peer->sessions)); + peer ? Curl_llist_count(&peer->sessions) : 0); return result; }