http2: clear the h2 session at delete

When calling nghttp2 to delete session, clear the pointer to avoid risk
of UAF.

Pointed out by Codex Security

Closes #20975
This commit is contained in:
Daniel Stenberg 2026-03-18 10:12:46 +01:00
parent 02e04eaee7
commit a43ea5943b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -203,6 +203,7 @@ static void cf_h2_ctx_close(struct cf_h2_ctx *ctx)
{
if(ctx->h2) {
nghttp2_session_del(ctx->h2);
ctx->h2 = NULL;
}
}