Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-170

bson_iterator_bin_data returns a pointer 4 bytes before the actual data

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      It seams that the 'BSON_BIN_BINARY_OLD' test is swapped between length and data function :

      MONGO_EXPORT int bson_iterator_bin_len( const bson_iterator *i ) {
      return ( bson_iterator_bin_type( i ) == BSON_BIN_BINARY_OLD )
      ? bson_iterator_int_raw( i ) - 4
      : bson_iterator_int_raw( i );
      }

      MONGO_EXPORT const char *bson_iterator_bin_data( const bson_iterator *i ) {
      return ( bson_iterator_bin_type( i ) == BSON_BIN_BINARY_OLD )
      ? bson_iterator_value( i ) + 9
      : bson_iterator_value( i ) + 5;
      }

      Attachments

        Activity

          People

            gjmurakami Gary Murakami
            mogice mog
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: