summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2016-02-25 18:37:03 -0500
committersamantharitter <samantha.ritter@10gen.com>2016-02-26 10:56:28 -0500
commit0030e3176dc6c6ee60be204c6df1c6913ffda83d (patch)
tree6cae2522f092cbff7ff6ea65ae434b7288a72055 /src/mongo/scripting
parent4ba65cba550e4589e46f63870e47322397001b1f (diff)
downloadmongo-0030e3176dc6c6ee60be204c6df1c6913ffda83d.tar.gz
SERVER-22693 Avoid unsafe cast to long long in ValueWriter
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/mozjs/valuewriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/valuewriter.cpp b/src/mongo/scripting/mozjs/valuewriter.cpp
index 8767c7e83ac..eebf20c96bc 100644
--- a/src/mongo/scripting/mozjs/valuewriter.cpp
+++ b/src/mongo/scripting/mozjs/valuewriter.cpp
@@ -363,7 +363,7 @@ void ValueWriter::_writeObject(BSONObjBuilder* b,
JS::RootedValue dateval(_context);
o.callMethod("getTime", &dateval);
- auto d = Date_t::fromMillisSinceEpoch(ValueWriter(_context, dateval).toNumber());
+ auto d = Date_t::fromMillisSinceEpoch(ValueWriter(_context, dateval).toInt64());
b->appendDate(sd, d);
return;