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

Escape JSON strings for regex, symbol, and DBPointer types

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.0
    • Affects Version/s: 1.6.3
    • Component/s: libbson
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved: