BSON cuts off strings at \x00

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The bson parser uses strlen, not the length field, to get the length of the string. Thus, if you insert a valid UTF8 string like: "y\x00z", it will return "y".

      > db.foo.insert(

      {x:"y\x00z"}

      )
      > db.foo.find()

      { "_id" : ObjectId("4c0515f068c88adddc836fc1"), "x" : "y" }

              Assignee:
              DO NOT USE - Backlog - Platform Team
              Reporter:
              Kristina Chodorow (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: