Bug 947902 - Make dumpHeapComplete ignore file args with --fuzzing-safe. r=billm

--HG--
extra : rebase_source : b9c2d6441b095cb92586a24d4471174c65173195
This commit is contained in:
Christian Holler 2013-12-09 19:27:51 +01:00
parent c097e70a19
commit faefddd17b

View File

@ -880,15 +880,17 @@ DumpHeapComplete(JSContext *cx, unsigned argc, jsval *vp)
if (argc > i) {
Value v = args[i];
if (v.isString()) {
JSString *str = v.toString();
JSAutoByteString fileNameBytes;
if (!fileNameBytes.encodeLatin1(cx, str))
return false;
const char *fileName = fileNameBytes.ptr();
dumpFile = fopen(fileName, "w");
if (!dumpFile) {
JS_ReportError(cx, "can't open %s", fileName);
return false;
if (!fuzzingSafe) {
JSString *str = v.toString();
JSAutoByteString fileNameBytes;
if (!fileNameBytes.encodeLatin1(cx, str))
return false;
const char *fileName = fileNameBytes.ptr();
dumpFile = fopen(fileName, "w");
if (!dumpFile) {
JS_ReportError(cx, "can't open %s", fileName);
return false;
}
}
++i;
}