Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.0
-
None
-
-
f11c40b55f (qt/qtremoteobjects/dev) 20b9e5c590 (qt/qtremoteobjects/6.3) 6a09220777 (qt/qtremoteobjects/6.2) 6a09220777 (qt/tqtc-qtremoteobjects/6.2) 20b9e5c590 (qt/tqtc-qtremoteobjects/6.3) f11c40b55f (qt/tqtc-qtremoteobjects/dev)
Description
QRemoteObjectHost::hostUrl() crashes if it is called before a valid URL has been set with QRemoteObjectHost::setHostUrl(QUrl).
hostUrl() calls d->remoteObjectIo->serverAddress() without checking if remoteObjectIo is valid. remoteObjectIo gets created in setHostUrl(QUrl).
QRemoteObjectHostBase::enableRemoting(QObject *object, const SourceApiMap *api, QObject *adapter) is missing that check too.
The attached patch fixes both crashes.
Attachments
For Gerrit Dashboard: QTBUG-85124 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
392365,4 | Check nullptr before using pointer | dev | qt/qtremoteobjects | Status: MERGED | +2 | 0 |
394948,2 | Check nullptr before using pointer | 6.3 | qt/qtremoteobjects | Status: MERGED | +2 | 0 |
394949,2 | Check nullptr before using pointer | 6.2 | qt/qtremoteobjects | Status: MERGED | +2 | 0 |
394950,2 | Check nullptr before using pointer | tqtc/lts-5.15 | qt/tqtc-qtremoteobjects | Status: MERGED | +2 | 0 |