mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 682727 - Handle OOM in xpc_qsDOMString and xpc_qsAUTF8String
This commit is contained in:
parent
f4b39ee317
commit
a8787b2748
@ -726,8 +726,10 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, jsval v, jsval *pval,
|
||||
|
||||
size_t len;
|
||||
const jschar *chars = JS_GetStringCharsZAndLength(cx, s, &len);
|
||||
if (!chars)
|
||||
if (!chars) {
|
||||
mValid = JS_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
new(mBuf) implementation_type(chars, len);
|
||||
mValid = JS_TRUE;
|
||||
@ -772,8 +774,10 @@ xpc_qsAUTF8String::xpc_qsAUTF8String(JSContext *cx, jsval v, jsval *pval)
|
||||
|
||||
size_t len;
|
||||
const PRUnichar *chars = JS_GetStringCharsZAndLength(cx, s, &len);
|
||||
if (!chars)
|
||||
if (!chars) {
|
||||
mValid = JS_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
new(mBuf) implementation_type(chars, len);
|
||||
mValid = JS_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user