Fix error in addrlen field

addrlen must be initialize to the amount of space available
in the buffer.

Change-Id: I52945d780bba9d22aeaa7ac5a35a0e54dbea60dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Andrew Stanley-Jones 2012-02-21 21:37:57 +01:00 committed by Qt by Nokia
parent 361cd9f9b2
commit c354b4f12f

View File

@ -215,7 +215,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor)
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
struct ::sockaddr_un addr; struct ::sockaddr_un addr;
socklen_t len; QT_SOCKLEN_T len = sizeof(addr);
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
if (0 == ::getsockname(listenSocket, (sockaddr *)&addr, &len)) { if (0 == ::getsockname(listenSocket, (sockaddr *)&addr, &len)) {
// check for absract sockets // check for absract sockets