summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorWaley Chen <waleycz@gmail.com>2016-08-08 15:11:10 -0400
committerWaley Chen <waleycz@gmail.com>2016-08-08 17:49:11 -0400
commit1257f4f5cc2c5a09383c1ddcd3d03bc83809ca18 (patch)
tree4e8cddd85f903fe867aa01534214f2bfb3ea071b /src/mongo/scripting
parent11394b9e5d77613ddc4e9abaaf5caa82c9128fa2 (diff)
downloadmongo-1257f4f5cc2c5a09383c1ddcd3d03bc83809ca18.tar.gz
SERVER-25482 Coverity analysis defect 99830: Unchecked return value
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/mozjs/objectwrapper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/objectwrapper.cpp b/src/mongo/scripting/mozjs/objectwrapper.cpp
index 4454ebf09b4..5c921c1ebec 100644
--- a/src/mongo/scripting/mozjs/objectwrapper.cpp
+++ b/src/mongo/scripting/mozjs/objectwrapper.cpp
@@ -552,7 +552,10 @@ ObjectWrapper::WriteFieldRecursionFrame::WriteFieldRecursionFrame(JSContext* cx,
if (isArray) {
uint32_t length;
- JS_GetArrayLength(cx, thisv, &length);
+ if (!JS_GetArrayLength(cx, thisv, &length)) {
+ throwCurrentJSException(
+ cx, ErrorCodes::JSInterpreterFailure, "Failure to get array length");
+ }
if (!ids.reserve(length)) {
throwCurrentJSException(