summaryrefslogtreecommitdiff
path: root/src/bluetooth/qbluetoothsocket.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-10-01 13:15:54 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-10-01 13:16:30 +0200
commitf835812b24b47f1d5a6766fd227ca32559295129 (patch)
tree092975324fc7a828f74228f742d1d8dd012f23d1 /src/bluetooth/qbluetoothsocket.cpp
parent48e81b139729b58e3c72ab82f2d1642eefc3a047 (diff)
parent22042412de27c2fedec852051fe7fffcaf431a2e (diff)
downloadqtconnectivity-f835812b24b47f1d5a6766fd227ca32559295129.tar.gz
Merge branch '5.4' into btle
Change-Id: I3c00855a33c1015d159a67e5548fd29164668929
Diffstat (limited to 'src/bluetooth/qbluetoothsocket.cpp')
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index dba9a25b..3232ae20 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -54,6 +54,8 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_QNX)
\brief The QBluetoothSocket class enables connection to a Bluetooth device
running a bluetooth server.
+ \since 5.2
+
QBluetoothSocket supports two socket types, \l {QBluetoothServiceInfo::L2capProtocol}{L2CAP} and
\l {QBluetoothServiceInfo::RfcommProtocol}{RFCOMM}.
@@ -646,6 +648,13 @@ quint16 QBluetoothSocket::peerPort() const
qint64 QBluetoothSocket::writeData(const char *data, qint64 maxSize)
{
Q_D(QBluetoothSocket);
+
+ if (!data || maxSize <= 0) {
+ d_ptr->errorString = tr("Invalid data/data size");
+ setSocketError(QBluetoothSocket::OperationError);
+ return -1;
+ }
+
return d->writeData(data, maxSize);
}