Fix duplication UnixFD during demarshall

Fix uninitialized UnixFD private data
pull/2/head
Slávek Banko 11 years ago
parent ecbec64293
commit 89be802574

@ -599,8 +599,11 @@ static TQT_DBusData qFetchParameter(DBusMessageIter *it)
return TQT_DBusData::fromStruct(memberList);
}
case DBUS_TYPE_UNIX_FD:
return TQT_DBusData::fromUnixFd(TQT_DBusUnixFd(qIterGet<dbus_uint32_t>(it)));
case DBUS_TYPE_UNIX_FD: {
TQT_DBusUnixFd unixFd;
unixFd.giveFileDescriptor(qIterGet<dbus_uint32_t>(it));
return TQT_DBusData::fromUnixFd(unixFd);
}
#if 0
case DBUS_TYPE_INVALID:
// TODO: check if there is better way to detect empty arrays

@ -35,7 +35,7 @@ TQT_DBusUnixFd::TQT_DBusUnixFd(const TQT_DBusUnixFd& other) : d(other.d)
d->ref();
}
TQT_DBusUnixFd::TQT_DBusUnixFd(int other)
TQT_DBusUnixFd::TQT_DBusUnixFd(int other) : d(0)
{
setFileDescriptor(other);
}

Loading…
Cancel
Save