mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +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 str(cx, ResolvePath(cx, givenPath, scriptRelative));
|
||||
if (!str)
|
||||
return false;
|
||||
|
||||
JSAutoByteString filename(cx, str);
|
||||
if (!filename)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user