Bug 1574972 - Make nsJSUtils::GetCallingLocation() fallible. r=smaug

Some German web sites seem to have started to have file names with
hundreds of thousands of bytes long, which is causing OOM crashes on
Android.

Differential Revision: https://phabricator.services.mozilla.com/D42674

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-08-20 20:03:18 +00:00
Родитель acbd6a2b96
Коммит c0db818712
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -49,8 +49,7 @@ bool nsJSUtils::GetCallingLocation(JSContext* aContext, nsACString& aFilename,
return false;
}
aFilename.Assign(filename.get());
return true;
return aFilename.Assign(filename.get(), fallible);
}
bool nsJSUtils::GetCallingLocation(JSContext* aContext, nsAString& aFilename,
@ -60,8 +59,7 @@ bool nsJSUtils::GetCallingLocation(JSContext* aContext, nsAString& aFilename,
return false;
}
aFilename.Assign(NS_ConvertUTF8toUTF16(filename.get()));
return true;
return aFilename.Assign(NS_ConvertUTF8toUTF16(filename.get()), fallible);
}
uint64_t nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(JSContext* aContext) {