Skip to content

Tags: cefsharp/CefSharp

Tags

v152.0.60

Toggle v152.0.60's commit message
DevTools Client - Upgrade to 152.0.7977.83

v151.3.240

Toggle v151.3.240's commit message
Core - OnSelectClientCertificate own the copied certificate vector (#…

…5281)

* Fix deferred client certificate selection reading freed memory

CefCertificateCallbackWrapper held the offered certificate list as
`const X509CertificateList&`, bound to a stack local built in
ClientAdapter::OnSelectClientCertificate. Once that handler returned the
list was destroyed, so calling Select() at any later point walked freed
memory and threw inside the thumbprint-matching loop, taking the host
process down with it.

CEF explicitly permits answering later. cef_request_handler.h says to
return true and call Select "either in this method or at a later time",
so a wrapper that outlives the handler has to own the list it selects
from. It now holds a heap-allocated copy, freed in the finalizer. A ref
class cannot contain a std::vector by value, hence the pointer. Copying
the vector copies the reference-counted CefX509Certificate pointers, and
those references are what keep the certificates alive.

This is the remaining half of #2948. The comment above the caller reads
"Create a copy of the vector in an attempt to fix #2948", and the copy is
indeed made - but it is then bound by reference, so it dies at the same
instant the original would have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Remove the redundant certificate vector copy in ClientAdapter

The wrapper takes its own copy in its constructor, so the local copy added
by a51cdd3 in ClientAdapter::OnSelectClientCertificate is now pure
redundancy - two copies where one is needed. Pass `certificates` straight
through instead.

Also refreshes the comment on _certificateList, which described the caller's
stack local that this removes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: John Hodnik <jhodnik@activu.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

v151.3.170

Toggle v151.3.170's commit message
Upgrade to 151.3.17+gf059e67+chromium-151.0.7922.138 / Chromium 151.0…

….7922.138

v144.0.300

Toggle v144.0.300's commit message
appveyor.yml - Disable push to myget

- MyGet has been having issues and builds were failing when trying to push

v150.0.110

Toggle v150.0.110's commit message
appveyor.yml - Update as release branch

v149.0.60

Toggle v149.0.60's commit message
Upgrade to 149.0.6+g0d0eeb6+chromium-149.0.7827.201 / Chromium 149.0.…

…7827.201

v149.0.40

Toggle v149.0.40's commit message
appveyor.yml - Update as release branch

v144.0.270

Toggle v144.0.270's commit message
Upgrade to v144.0.27+g3fae261+chromium-144.0.7559.254

v144.0.260

Toggle v144.0.260's commit message
Upgrade to v144.0.26+g8b05ce5+chromium-144.0.7559.252

v148.0.90

Toggle v148.0.90's commit message
appveyor.yml - Upgrade as release branch