Use the correct macro to detect an invalid socket in tortls_nss.c

Fixes bug 27782; bugfix on 0.3.5.1-alpha
This commit is contained in:
Nick Mathewson 2018-09-20 12:55:31 -04:00
parent 62b709bc26
commit d6c564e09a
2 changed files with 5 additions and 1 deletions

4
changes/bug27782 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes (NSS):
- Correctly detect failure to open a dummy TCP socket when
stealing ownership of an fd from the NSS layer. Fixes bug 27782;
bugfix on 0.3.5.1-alpha.

View File

@ -444,7 +444,7 @@ tor_tls_release_socket(tor_tls_t *tls)
*/
tor_socket_t sock =
tor_open_socket_nonblocking(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (!sock) {
if (! SOCKET_OK(sock)) {
log_warn(LD_NET, "Out of sockets when trying to shut down an NSS "
"connection");
return;