summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-01-12 01:36:05 (GMT)
committerGuido van Rossum <guido@python.org>1996-01-12 01:36:05 (GMT)
commitca42b1673b09a1abee2f60015637fed94b8aabd8 (patch)
tree4539a1af404bc8beb74e3b3d87f4f07babf8c658 /Modules/socketmodule.c
parent71aa32f4af5bace5293ca87239db632aa7479c63 (diff)
downloadcpython-ca42b1673b09a1abee2f60015637fed94b8aabd8.zip
cpython-ca42b1673b09a1abee2f60015637fed94b8aabd8.tar.gz
cpython-ca42b1673b09a1abee2f60015637fed94b8aabd8.tar.bz2
clear addr buffer before calling getsockname
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 2987746..59d730c 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -671,6 +671,7 @@ BUILD_FUNC_DEF_2(PySocketSock_getsockname,PySocketSockObject *,s, PyObject *,arg
return NULL;
if (!getsockaddrlen(s, &addrlen))
return NULL;
+ memset(addrbuf, 0, addrlen);
Py_BEGIN_ALLOW_THREADS
res = getsockname(s->sock_fd, (struct sockaddr *) addrbuf, &addrlen);
Py_END_ALLOW_THREADS