mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
clear addr buffer before calling getsockname
This commit is contained in:
parent
71aa32f4af
commit
ca42b1673b
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue