Bug 1577273 - Use strnlen to test if source URLs are too long, r=tcampbell.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-08-28 22:48:45 +00:00
Родитель a105826a55
Коммит f00e1f1678
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -2276,7 +2276,8 @@ static bool RememberSourceURL(JSContext* cx, HandleScript script) {
}
const char* filename = script->filename();
if (!filename || strlen(filename) > SourceURLMaxLength) {
if (!filename ||
strnlen(filename, SourceURLMaxLength + 1) > SourceURLMaxLength) {
return true;
}