зеркало из https://github.com/mozilla/gecko-dev.git
Bug 790617 - Part 2 - don't use atoi to parse header. r=cbiesinger
This commit is contained in:
Родитель
d0f10170d1
Коммит
97d448526f
|
@ -1580,7 +1580,7 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
|
||||||
if (clen) {
|
if (clen) {
|
||||||
uploadChannel->SetUploadStream(mUploadStream,
|
uploadChannel->SetUploadStream(mUploadStream,
|
||||||
nsDependentCString(ctype),
|
nsDependentCString(ctype),
|
||||||
atoi(clen));
|
nsCRT::atoll(clen));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -954,7 +954,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
|
||||||
if (headerStr.LowerCaseEqualsLiteral("content-type")) {
|
if (headerStr.LowerCaseEqualsLiteral("content-type")) {
|
||||||
mContentType = headerVal;
|
mContentType = headerVal;
|
||||||
} else if (headerStr.LowerCaseEqualsLiteral("content-length")) {
|
} else if (headerStr.LowerCaseEqualsLiteral("content-length")) {
|
||||||
mContentLength = atoi(headerVal.get()); // XXX 64-bit math?
|
mContentLength = nsCRT::atoll(headerVal.get());
|
||||||
} else if (headerStr.LowerCaseEqualsLiteral("content-disposition")) {
|
} else if (headerStr.LowerCaseEqualsLiteral("content-disposition")) {
|
||||||
mContentDisposition = headerVal;
|
mContentDisposition = headerVal;
|
||||||
} else if (headerStr.LowerCaseEqualsLiteral("set-cookie")) {
|
} else if (headerStr.LowerCaseEqualsLiteral("set-cookie")) {
|
||||||
|
@ -988,14 +988,14 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
|
||||||
|
|
||||||
tmpPtr[0] = '\0';
|
tmpPtr[0] = '\0';
|
||||||
|
|
||||||
mByteRangeStart = atoi(range); // XXX want 64-bit conv
|
mByteRangeStart = nsCRT::atoll(range);
|
||||||
tmpPtr++;
|
tmpPtr++;
|
||||||
mByteRangeEnd = atoi(tmpPtr);
|
mByteRangeEnd = nsCRT::atoll(tmpPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
mIsByteRangeRequest = true;
|
mIsByteRangeRequest = true;
|
||||||
if (mContentLength == LL_MAXUINT)
|
if (mContentLength == LL_MAXUINT)
|
||||||
mContentLength = uint64_t(int64_t(mByteRangeEnd - mByteRangeStart + int64_t(1)));
|
mContentLength = uint64_t(mByteRangeEnd - mByteRangeStart + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*newLine = tmpChar;
|
*newLine = tmpChar;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче