Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 682727 - Handle OOM in xpc_qsDOMString and xpc_qsAUTF8String. r=j…
Browse files Browse the repository at this point in the history
…st, sr=joshmoz, a=blizzard
  • Loading branch information
vonasek committed Sep 30, 2011
1 parent de1704c commit bddf7da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/src/xpconnect/src/xpcquickstubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,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;
Expand Down Expand Up @@ -773,8 +775,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;
Expand Down

0 comments on commit bddf7da

Please sign in to comment.