Bug 617935: Check string lengths using StringBuffer. (r=lw)

This commit is contained in:
Chris Leary
2011-01-12 15:28:58 -08:00
parent cae5b716f6
commit 6164d16533
21 changed files with 453 additions and 286 deletions

View File

@@ -589,6 +589,10 @@ js_AtomizeChars(JSContext *cx, const jschar *chars, size_t length, uintN flags)
JSString str;
CHECK_REQUEST(cx);
if (!CheckStringLength(cx, length))
return NULL;
str.initFlatNotTerminated((jschar *)chars, length);
return js_AtomizeString(cx, &str, ATOM_TMPSTR | flags);
}