Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1452

bson_decode() should require exactly one document in buffer

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.6.8
    • Fix Version/s: 1.6.9
    • Component/s: pecl-mongo
    • Labels:
      None
    • # Replies:
      5
    • Last comment by Customer:
      true
    • Sprint:
      PHP Sprint 21

      Description

      While reviewing invalid BSON tests from the Python driver, we noted that buffers with extra, trailing data are considered invalid.

      Currently, bson_to_zval() returns after parsing a document and ignores any trailing data in the buffer string. While that behavior is reasonable for cursors, where iteration repeatedly invokes the function on its larger buffer (derived from the OP_REPLY message), we probably don't want to do that with bson_decode(). Instead, bson_decode() should ensure that the buffer it receives is exactly one document.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jmikola Jeremy Mikola
                Reporter:
                jmikola Jeremy Mikola
                Participants:
                Last commenter:
                Rathi Gnanasekaran (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  4 years, 33 weeks, 4 days ago
                  Date of 1st Reply: