Document and repair edge cases in ByteBuffer

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • bson-4.6.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      Address the following in the documentation:

      put_bytes vs put_string
      put_string vs put_cstring
      rewind! only affects read position
      put_symbol and put_string accepting null bytes in input strings/symbols
      put_symbol writing the symbol as string

      Repair the following bugs:

      Providing a string of length > 1 to put_byte writes only the first byte to the buffer
      Providing a string of length 0 to put_byte reads undefined data, writes it to buffer and advances write position by 1
      replace_int32 performs no range check on position argument, can overwrite arbitrary data not belonging to the buffer
      put_symbol truncates symbols containing null bytes

      Add tests as needed.

            Assignee:
            Oleg Pudeyev (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: