Allow deserializing from over-length buffers

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Rust Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, we require that the length of the buffer when parsing bson be the same as the length as reported in the serialized bson itself. We could potentially relax this to allow the input to be longer than the bson length and operate on a sub-slice; this would require some minor refactoring since we use RawDocument::from_bytes extensively for internal parsing and rely on it validating the buffer length for that, so we'd need to introduce another function that has the looser validation and use it where we want to relax the invariant (e.g. bson::from_slice).

      (Source: https://github.com/mongodb/bson-rust/issues/504)

            Assignee:
            Unassigned
            Reporter:
            Abraham Egnor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: