]> git.ipfire.org Git - thirdparty/curl.git/commit
vtls_scache: fix race condition
authorJay Satiro <raysatiro@yahoo.com>
Thu, 2 Oct 2025 13:46:36 +0000 (09:46 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 2 Oct 2025 15:33:44 +0000 (11:33 -0400)
commit2a25ebe9580e52b375533a7d12a86dff29a36c44
treea9d964d0128ca0eadf693fa8fc865495045e4132
parent03fe4467894848fc58a82a30e25f0d70f793baa7
vtls_scache: fix race condition

- Lock before counting the cache sessions.

Prior to this change when taking a session a trace command counted the
sessions but not under lock, which caused a race condition.

Reported by: Viktor Szakats

Fixes https://github.com/curl/curl/issues/18806
Closes https://github.com/curl/curl/pull/18813
lib/vtls/vtls_scache.c