mirror of https://github.com/python/cpython
clear addr buffer before calling getsockname
This commit is contained in:
parent
71aa32f4af
commit
ca42b1673b
|
@ -671,6 +671,7 @@ BUILD_FUNC_DEF_2(PySocketSock_getsockname,PySocketSockObject *,s, PyObject *,arg
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!getsockaddrlen(s, &addrlen))
|
if (!getsockaddrlen(s, &addrlen))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
memset(addrbuf, 0, addrlen);
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
res = getsockname(s->sock_fd, (struct sockaddr *) addrbuf, &addrlen);
|
res = getsockname(s->sock_fd, (struct sockaddr *) addrbuf, &addrlen);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
Loading…
Reference in New Issue