network requests: do not access 1st byte of empty byte array
... because otherwise this would crash. Apparently there are cases where the header name is empty. Task-number: QTBUG-31667 Change-Id: I31b3e964502c05b7614c23876bb3752fa75ab22d Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>bb10
parent
19ed991e56
commit
dd050d35d7
|
|
@ -752,7 +752,8 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria
|
|||
|
||||
static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName)
|
||||
{
|
||||
// headerName is not empty here
|
||||
if (headerName.isEmpty())
|
||||
return QNetworkRequest::KnownHeaders(-1);
|
||||
|
||||
switch (tolower(headerName.at(0))) {
|
||||
case 'c':
|
||||
|
|
|
|||
Loading…
Reference in New Issue