修复ssl_stream_new中不必要的getpeername以及由此造成的写越界。

This commit is contained in:
zhengchao
2018-09-07 15:19:28 +08:00
parent 3810d4d1f9
commit 89b79eab60
2 changed files with 2 additions and 4 deletions

View File

@@ -234,14 +234,12 @@ void ssl_free_chello(struct ssl_chello * p)
struct ssl_stream * ssl_stream_new(struct ssl_mgr * mgr, evutil_socket_t fd, enum tfe_conn_dir dir,
struct ssl_chello * client_hello, struct keyring * kyr)
{
struct sockaddr addr;
socklen_t addrlen;
int ret = 0;
struct ssl_stream * s_stream = ALLOC(struct ssl_stream, 1);
s_stream->dir = dir;
s_stream->mgr = mgr;
s_stream->_do_not_use.fd = fd;
ret = getpeername(fd, &addr, &addrlen);
assert(ret == 0);
switch (dir)
{