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

Escape JSON strings for regex, symbol, and DBPointer types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.6.3
    • 1.7.0
    • libbson
    • None

    Description

      When converting BSON to JSON and extended JSON, bson_utf8_escape_for_json() should be used to escape strings for the regex, symbol, and DBPointer types. Escaping is currently done for keys, UTF-8 strings, code (w/ and w/o scope) types.

      Note: escaping regex patterns with bson_utf8_escape_for_json() causes the following BSON corpus test case to fail: regex with slash. JSON does not require forward slashes to be escaped, so this may mean that bson_utf8_escape_for_json() is too aggressive.

      Attachments

        Issue Links

          Activity

            People

              jesse@mongodb.com A. Jesse Jiryu Davis
              jmikola@mongodb.com Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: