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

Corrupt GridFS files can send GridOut.read / readline into an infinite loop

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.3, 2.9
    • Affects Version/s: None
    • Component/s: None
    • None

      A test case that hangs at GridOut.read:

      import pymongo
      from bson.binary import Binary
      from gridfs import GridFS
      client = pymongo.MongoClient()
      db = client.test
      gfs = GridFS(db)
      files_id = gfs.put('foobar')
      db.fs.chunks.update({'files_id': files_id}, {'$set': {'data': Binary('foo', 0)}})
      out = gfs.get(files_id)
      out.read()
      

      The same problem occurs in GridOut.readline.

      This problem was reported here: https://github.com/mongodb/mongo-python-driver/pull/271

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: