mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 945568 - Properly handle OOM in ReadFile. r=terrence
--HG-- extra : rebase_source : 4734a64a1c89b43421f8dab0bda417cf7b8978c3
This commit is contained in:
parent
3b387245d0
commit
ae901ef97f
@ -3390,6 +3390,9 @@ ReadFile(JSContext *cx, unsigned argc, jsval *vp, bool scriptRelative)
|
|||||||
|
|
||||||
RootedString givenPath(cx, args[0].toString());
|
RootedString givenPath(cx, args[0].toString());
|
||||||
RootedString str(cx, ResolvePath(cx, givenPath, scriptRelative));
|
RootedString str(cx, ResolvePath(cx, givenPath, scriptRelative));
|
||||||
|
if (!str)
|
||||||
|
return false;
|
||||||
|
|
||||||
JSAutoByteString filename(cx, str);
|
JSAutoByteString filename(cx, str);
|
||||||
if (!filename)
|
if (!filename)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user