From 1bc91fd5d7bac6f8efe62d9fd6ac5463bf0b4da3 Mon Sep 17 00:00:00 2001 From: CALVIN NGUYEN Date: Tue, 26 May 2026 09:28:14 -0700 Subject: [PATCH] SERVER-119444 Ensure JSThread args BSON is owned before cross-thread handoff (#53882) GitOrigin-RevId: ce1bd0268d8a81a7553ab1e7edf08f163d89665a --- src/mongo/scripting/mozjs/shell/jsthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo/scripting/mozjs/shell/jsthread.cpp b/src/mongo/scripting/mozjs/shell/jsthread.cpp index 0f319e52529..8d3bdf86a99 100644 --- a/src/mongo/scripting/mozjs/shell/jsthread.cpp +++ b/src/mongo/scripting/mozjs/shell/jsthread.cpp @@ -121,7 +121,7 @@ public: uasserted(ErrorCodes::JSInterpreterFailure, "Failed to JS::NewArrayObject"); } - _sharedData->_args = ObjectWrapper(cx, robj).toBSON(); + _sharedData->_args = ObjectWrapper(cx, robj).toBSON().getOwned(); _sharedData->_stack = currentJSStackToString(cx);