diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 9df06328a1..cb4614bb0a 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -1043,7 +1043,14 @@ QDateTime QNetworkHeadersPrivate::fromHttpDate(const QByteArray &value) if (pos == 3) { char month_name[4]; int day, year, hour, minute, second; +#ifdef Q_CC_MSVC + // Use secure version to avoid compiler warning + if (sscanf_s(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, 4, &year, &hour, &minute, &second) == 6) +#else + // The POSIX secure mode is %ms (which allocates memory), too bleeding edge for now + // In any case this is already safe as field width is specified. if (sscanf(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, &year, &hour, &minute, &second) == 6) +#endif dt = QDateTime(QDate(year, name_to_month(month_name), day), QTime(hour, minute, second)); } else { QLocale c = QLocale::c(); diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 7abcb24291..8d1c134d7d 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1378,8 +1378,7 @@ QAbstractSocket::~QAbstractSocket() */ void QAbstractSocket::resume() { - Q_D(QAbstractSocket); - d->resumeSocketNotifiers(this); + QAbstractSocketPrivate::resumeSocketNotifiers(this); } /*!