Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6646

Strings with NUL bytes don't round-trip correctly from BSON <-> JavaScript

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.4.5, 2.5.0
    • JavaScript
    • None
    • Minor Change
    • ALL

    Description

      SpiderMonkey: JS -> BSON is correct, but not BSON -> JS
      V8: I think both are broken

      See v8 build failure at http://buildlogs.mongodb.org/build/5016c861d2a60f1068000491/test/5016c87dd2a60f1326000417/

      That test passes on SM but this fails:

      > db.foo.drop()
      true
      > db.foo.insert({key:'adsf\0asdf'})
      > db.foo.findOne()
      { "_id" : ObjectId("5016cec9eee3e47040cf29dd"), "key" : "adsf" }

      Note that it is written to the db correctly and readable by pymongo:

      In [5]: db.foo.find_one()
      Out[5]: {'_id': ObjectId('5016cec9eee3e47040cf29dd'), 'key': 'adsf\x00asdf'}

      Attachments

        Issue Links

          Activity

            People

              mathias@mongodb.com Mathias Stearn
              mathias@mongodb.com Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: