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

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.5, 2.5.0
    • Component/s: JavaScript
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: