diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-08-27 15:00:00 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-08-27 15:00:25 -0400 |
commit | 449fbabe26b62250b4974aaec2633cb591e36f28 (patch) | |
tree | 53857889435f87d89d32f5e09813136369ba291e /scripting | |
parent | b08b0b6e9f949e566b0d4271f70474223aab6761 (diff) | |
download | mongo-449fbabe26b62250b4974aaec2633cb591e36f28.tar.gz |
have to copy BinData in sm in case BSONObj is temp SERVER-1694
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index 3480c2fd4c0..cb3ad2092a3 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -670,7 +670,8 @@ namespace mongo { CHECKNEWOBJECT(o,_context,"Bindata_BinData1"); int len; const char * data = e.binData( len ); - assert( JS_SetPrivate( _context , o , new BinDataHolder( data ) ) ); + assert( data ); + assert( JS_SetPrivate( _context , o , new BinDataHolder( data , len ) ) ); setProperty( o , "len" , toval( (double)len ) ); setProperty( o , "type" , toval( (double)e.binDataType() ) ); |