pipacs / o2

OAuth 2.0 for Qt
BSD 2-Clause "Simplified" License
317 stars 147 forks source link

Prevent crash in O2Requestor::onRequestFinished() #115

Closed Timac closed 6 years ago

Timac commented 6 years ago

We have seen some crashes in O2Requestor::onRequestFinished(). When the sender() is cast to QNetworkReply*, the pointer is not checked and this can led to a NULL dereference when calling senderReply->error().

The fix consists of performing the safety checks in the same order as O2Requestor::onRequestError(). The pointer dereference occurs only after reply_ == senderReply which should prevent the crash.

pipacs commented 6 years ago

Thanks!