diff options
author | Waley Chen <waleycz@gmail.com> | 2016-08-08 15:11:10 -0400 |
---|---|---|
committer | Waley Chen <waleycz@gmail.com> | 2016-08-08 17:49:11 -0400 |
commit | 1257f4f5cc2c5a09383c1ddcd3d03bc83809ca18 (patch) | |
tree | 4e8cddd85f903fe867aa01534214f2bfb3ea071b /src/mongo/scripting | |
parent | 11394b9e5d77613ddc4e9abaaf5caa82c9128fa2 (diff) | |
download | mongo-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.cpp | 5 |
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( |