diff --git a/events/events_network.c b/events/events_network.c index c81338f8..73d6aa79 100644 --- a/events/events_network.c +++ b/events/events_network.c @@ -22,8 +22,8 @@ * for it to be larger than size_t unless there's an undocumented limit on * the number of descriptors which can be polled (since poll takes an array, * the size of which must fit into a size_t); and nfds_t should be able to - * the value INT_MAX + 1 (in case every possible file descriptor is in use - * and being polled for). + * store the value INT_MAX + 1 (in case every possible file descriptor is in + * use and being polled for). */ CTASSERT((nfds_t)(-1) <= (size_t)(-1)); CTASSERT((nfds_t)((size_t)(INT_MAX) + 1) == (size_t)(INT_MAX) + 1); @@ -65,7 +65,7 @@ static size_t fdscanpos; * S[i].reader != NULL <==> (fds[S[i].pollpos].events & POLLIN) != 0 * S[i].writer != NULL <==> (fds[S[i].pollpos].events & POLLOUT) != 0 * 5. We don't have events ready which we don't want: - * (fds[j].revents & (POLLIN | POLLOUT) & (~fds[j].events])) == 0 + * (fds[j].revents & (POLLIN | POLLOUT) & (~fds[j].events)) == 0 * 6. Returned events are in position to be scanned later: * fds[j].revents != 0 ==> f < fdscanpos. */ @@ -451,7 +451,7 @@ events_network_get(void) break; } - /* Are we ready for reading? */ + /* Are we ready for writing? */ if (fds[fdscanpos].revents & POLLOUT) { r = socketlist_get(S, (size_t)fds[fdscanpos].fd)->writer; diff --git a/network_ssl/network_ssl.c b/network_ssl/network_ssl.c index 51b83cd5..02ef2dd1 100644 --- a/network_ssl/network_ssl.c +++ b/network_ssl/network_ssl.c @@ -245,7 +245,7 @@ docallback(int (* callback)(void *, ssize_t), void * cookie, ssize_t len, /* * Zero the callback pointer; the callback might want to request - * another read/write operation so we need to get out of the way. + * another read/write operation, so we need to get out of the way. */ *callback_ptr = NULL; diff --git a/network_ssl/network_ssl_compat.c b/network_ssl/network_ssl_compat.c index 5e1d0f00..f8926c40 100644 --- a/network_ssl/network_ssl_compat.c +++ b/network_ssl/network_ssl_compat.c @@ -10,7 +10,7 @@ #ifdef NETWORK_SSL_COMPAT_TLS_CLIENT_METHOD /** * network_ssl_compat_TLS_client_method(void): - * Create a SSL_METHOD. + * Create an SSL_METHOD. * * COMPATIBILITY: Behave like TLS_client_method(). */ @@ -35,7 +35,7 @@ network_ssl_compat_CTL_set_min_proto_version(SSL_CTX * ctx, int version) { long options; - /* This the only version currently supported in this file. */ + /* This is the only version currently supported in this file. */ assert(version == TLS1_2_VERSION); /* Disable all protocols lower than TLS1_2_VERSION. */ diff --git a/network_ssl/network_ssl_compat.h b/network_ssl/network_ssl_compat.h index 70fe49f5..cf74e56f 100644 --- a/network_ssl/network_ssl_compat.h +++ b/network_ssl/network_ssl_compat.h @@ -52,7 +52,7 @@ #ifdef NETWORK_SSL_COMPAT_TLS_CLIENT_METHOD /** * network_ssl_compat_TLS_client_method(void): - * Create a SSL_METHOD. + * Create an SSL_METHOD. * * COMPATIBILITY: Behave like TLS_client_method(). */ diff --git a/util/sock.c b/util/sock.c index ce4da55a..fa6eadf7 100644 --- a/util/sock.c +++ b/util/sock.c @@ -34,6 +34,8 @@ sock_resolve_unix(const char * addr) if ((sa_un = calloc(1, sizeof(struct sockaddr_un))) == NULL) goto err0; sa_un->sun_family = AF_UNIX; + + /* Safely copy addr into the structure. */ if (strlen(addr) >= sizeof(sa_un->sun_path)) { warn0("socket path too long: %s", addr); goto err1;