Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-370

pymongo bson segfault

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fedora 17, pymongo 2.1.1

      I just tried loading an invalid BSON document using the bson module from pymongo. I would expect this to throw an exception, not segfault. (I'm aware that validation isn't used, but I think that is a separate issue from segfaulting, which is almost never acceptable).

      [christian@chergert-x1 sandbox]$ python
      Python 2.7.3 (default, Apr 30 2012, 21:18:11)
      [GCC 4.7.0 20120416 (Red Hat 4.7.0-2)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import pymongo
      >>> pymongo.version
      '2.1.1'
      >>> import bson
      >>> d = '\x00' * 20000000
      >>> b = bson.BSON(d)
      >>> b.decode()
      Segmentation fault

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            christian Christian Hergert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: