Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1977

Document and repair edge cases in ByteBuffer

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

      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@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: