Details
Description
When using a proxy list with more than one proxy (http=http.proxy.de:8000;https=https.proxy.de:8080) the parsing fails when trying to parse the portnumber.
This Bug ist blocking because it leads to a Qtcreator crash.
Possible fix: add an additional inner loop over an "const QStringList &entryList = listEntry.split(QLatin1Char(';'), QString::SkipEmptyParts)"
static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, const QStringList &proxyList) { // Reference documentation from Microsoft: // http://msdn.microsoft.com/en-us/library/aa383912(VS.85).aspx // // According to the website, the proxy server list is // one or more of the space- or semicolon-separated strings in the format: // ( QList<QNetworkProxy> result; foreach (const QString & listEntry, proxyList) { // THE NEW LOOP const QStringList &entryList = listEntry.split(QLatin1Char(';'), QString::SkipEmptyParts); foreach (const QString & entry, entryList) { int server = 0; int pos = entry.indexOf(QLatin1Char('=')); if (pos != -1) { QStringRef scheme = entry.leftRef(pos); if (scheme != query.protocolTag()) continue; server = pos + 1; } QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy; quint16 port = 8080; pos = entry.indexOf(QLatin1String("://"), server); if (pos != -1) { QStringRef scheme = entry.midRef(server, pos - server); if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) { // no-op // defaults are above } else if (scheme == QLatin1String("socks") || scheme == QLatin1String("socks5")) { proxyType = QNetworkProxy::Socks5Proxy; port = 1080; } else { // unknown proxy type continue; } server = pos + 3; } pos = entry.indexOf(QLatin1Char(':'), server); if (pos != -1) { bool ok; uint value = entry.mid(pos + 1).toUInt(&ok); if (!ok || value > 65535) continue; // invalid port number port = value; } else { pos = entry.length(); } result << QNetworkProxy(proxyType, entry.mid(server, pos - server), port); } } return result; }