Skip to content
Commit 1ae891c6 authored by David Benjamin's avatar David Benjamin
Browse files

Save and restore the Windows error around TlsGetValue.



TlsGetValue clears the last error even on success, so that callers may
distinguish it successfully returning NULL or failing. This error-mangling
behavior interferes with the caller's use of GetLastError. In particular
SSL_get_error queries the error queue to determine whether the caller should
look at the OS's errors. To avoid destroying state, save and restore the
Windows error.

Fixes #6299.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>

(cherry picked from commit 2de108df)

(Merged from https://github.com/openssl/openssl/pull/6349)
parent 926b2111
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment