diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-21 22:23:08 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-21 22:23:08 (GMT) |
commit | c6137472df3ef7799d41cee1af2f8efa86e702cf (patch) | |
tree | 3aaf55703b129269b740ab6a5a957b654c436133 | |
parent | 383a7129a1dffc54d8ebbc2c6497792b72fea6f1 (diff) | |
parent | 7905e38d84a060176e53ffe8d7da8710ea0180fe (diff) | |
download | Qt-c6137472df3ef7799d41cee1af2f8efa86e702cf.zip Qt-c6137472df3ef7799d41cee1af2f8efa86e702cf.tar.gz Qt-c6137472df3ef7799d41cee1af2f8efa86e702cf.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Validate arguments to QDBusConnection::connect
-rw-r--r-- | src/dbus/qdbusconnection.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index eb312d2..3fb63eb 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -632,10 +632,26 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const if (!receiver || !slot || !d || !d->connection) return false; - if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) - return false; if (interface.isEmpty() && name.isEmpty()) return false; + if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) { +#ifndef QT_NO_DEBUG + qWarning("QDBusConnection::connect: interface name '%s' is not valid", interface.toLatin1().constData()); +#endif + return false; + } + if (!service.isEmpty() && !QDBusUtil::isValidBusName(service)) { +#ifndef QT_NO_DEBUG + qWarning("QDBusConnection::connect: service name '%s' is not valid", service.toLatin1().constData()); +#endif + return false; + } + if (!path.isEmpty() && !QDBusUtil::isValidObjectPath(path)) { +#ifndef QT_NO_DEBUG + qWarning("QDBusConnection::connect: object path '%s' is not valid", path.toLatin1().constData()); +#endif + return false; + } QDBusWriteLocker locker(ConnectAction, d); return d->connectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot); |