Bug 1344558 - Avoid OOM in nsSimpleURI::SetPath r=mcmanus

MozReview-Commit-ID: JWlN5Q6H59Q

--HG--
extra : rebase_source : f3f1971f33d8fe6b560c1a9aca307219725713c6
This commit is contained in:
Valentin Gosu 2017-03-05 22:55:45 +01:00
parent 855c64b0d5
commit 55e829f800

View File

@ -424,7 +424,10 @@ nsSimpleURI::SetPath(const nsACString &aPath)
{
NS_ENSURE_STATE(mMutable);
nsAutoCString path(aPath);
nsAutoCString path;
if (!path.Assign(aPath, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
int32_t queryPos = path.FindChar('?');
int32_t hashPos = path.FindChar('#');