Skip to content

schannel: clear borrowed sslContext on close - #22720

Closed
martin-fzi wants to merge 1 commit into
curl:masterfrom
martin-fzi:master
Closed

martin-fzi wants to merge 1 commit into
curl:masterfrom
martin-fzi:master

Conversation

@martin-fzi

Copy link
Copy Markdown

The current Negotiate and NTLM consumers were traced, and no reachable post-free dereference was found.

The pointer is still left dangling after Schannel teardown, so clear it when the context is destroyed.

Comment thread lib/vtls/schannel.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Clears Schannel’s borrowed connection-level security context before freeing its backing handle.

Changes:

  • Nulls sslContext only when it references the context being destroyed.
  • Preserves compatibility with older Windows SDKs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vszakats

Copy link
Copy Markdown
Member

I opened #22725 which enables
channel binding for all supported toolchains, and thus makes
the macro guard (and comment) redundant.

Perhaps it's best to merge that first, then rebase this PR to make
another CI run with this unlocked for old mingw-w64.

Comment thread lib/vtls/schannel.c Outdated
@jay jay closed this in 8071d7a Sep 5, 2026
@jay

jay commented Sep 5, 2026

Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TLS Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

4 participants