Bug 1766647 - Check readString result in JS_ReadString r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D144887
This commit is contained in:
Kagami Sascha Rosylight 2022-04-28 21:59:17 +00:00
parent f63f7b9128
commit 194a177317

View File

@ -3613,8 +3613,11 @@ JS_PUBLIC_API bool JS_ReadString(JSStructuredCloneReader* r,
}
if (tag == SCTAG_STRING) {
str.set(r->readString(data));
return true;
if (JSString* s = r->readString(data)) {
str.set(s);
return true;
}
return false;
}
JS_ReportErrorNumberASCII(r->context(), GetErrorMessage, nullptr,