From da7b175556773260650d3ebf0c7366b7637e5bf4 Mon Sep 17 00:00:00 2001 From: Bogdan Postelnicu Date: Thu, 24 Dec 2015 14:14:43 -0500 Subject: [PATCH] Bug 1234177 - check to see if mFunctions.append returned error. r=bholley DONTBUILD because this is a backout/reland to fix author info. --- js/xpconnect/src/ExportHelpers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/xpconnect/src/ExportHelpers.cpp b/js/xpconnect/src/ExportHelpers.cpp index 891ecec2942..f387f50e7e5 100644 --- a/js/xpconnect/src/ExportHelpers.cpp +++ b/js/xpconnect/src/ExportHelpers.cpp @@ -205,7 +205,8 @@ public: if (JS::IsCallable(aObj)) { if (mOptions->cloneFunctions) { - mFunctions.append(aObj); + if (!mFunctions.append(aObj)) + return false; return JS_WriteUint32Pair(aWriter, SCTAG_FUNCTION, mFunctions.length() - 1); } else { JS_ReportError(aCx, "Permission denied to pass a Function via structured clone");