diff options
author | Guido van Rossum <guido@python.org> | 1996-01-12 01:36:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-01-12 01:36:05 (GMT) |
commit | ca42b1673b09a1abee2f60015637fed94b8aabd8 (patch) | |
tree | 4539a1af404bc8beb74e3b3d87f4f07babf8c658 /Modules/socketmodule.c | |
parent | 71aa32f4af5bace5293ca87239db632aa7479c63 (diff) | |
download | cpython-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.c | 1 |
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 |