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

Unchecked error in bson_utf8_escape_for_json

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 0.90.0
    • Fix Version/s: 1.2-beta0
    • Component/s: libbson
    • Labels:
      None
    • # Replies:
      23
    • Last comment by Customer:
      true
    • Story Points:
      4
    • Sprint:
      C Driver 2015Q2 sprint 3

      Description

      If bson_utf8_escape_for_json is called with an invalid sequence, e.g. one that begins with 0x80, it doesn't notice that bson_utf8_next_char and bson_utf8_get_char are returning nil. It loops forever on the invalid character, appending the escape sequence for nil, '\u0000', to the output string until it fails to realloc the output buffer and aborts.

        Activity

        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

        Message: Merge branch 'master' into 1.2.0-dev

        • master: (24 commits)
          1.1.11 Release
          CDRIVER-690 fix typo in error check
          CDRIVER-690 fix streaming example to use fd
          CDRIVER-690 clarify callback description
          CDRIVER-690 fix indentation and style
          CDRIVER-690 add BSON streaming read example
          CDRIVER-690 document bson_reader callbacks
          post-release bump
          1.1.10 Release
          post-release bump
          1.1.9 Release
          CDRIVER-727 actually enable coverage in libbson
          post-release bump
          1.1.8 Release
          post-release bump
          1.1.7 Release
          ensure CMake defines config vars to 0 or 1
          CDRIVER-700 unchecked err in bson_utf8_escape_for_json
          fix assert in test_bson_json_read_bad_cb
          %g prints with 3 exp digits by default on windows
          ...

        Conflicts:
        CMakeLists.txt
        NEWS
        build/autotools/Versions.m4
        build/rpm/libbson.spec
        doc/version.page
        tests/test-json.c
        Branch: debian
        https://github.com/mongodb/libbson/commit/69ae5fa4d8aefc296d36e251526cdad53ecd877a

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'} Message: Merge branch 'master' into 1.2.0-dev master: (24 commits) 1.1.11 Release CDRIVER-690 fix typo in error check CDRIVER-690 fix streaming example to use fd CDRIVER-690 clarify callback description CDRIVER-690 fix indentation and style CDRIVER-690 add BSON streaming read example CDRIVER-690 document bson_reader callbacks post-release bump 1.1.10 Release post-release bump 1.1.9 Release CDRIVER-727 actually enable coverage in libbson post-release bump 1.1.8 Release post-release bump 1.1.7 Release ensure CMake defines config vars to 0 or 1 CDRIVER-700 unchecked err in bson_utf8_escape_for_json fix assert in test_bson_json_read_bad_cb %g prints with 3 exp digits by default on windows ... Conflicts: CMakeLists.txt NEWS build/autotools/Versions.m4 build/rpm/libbson.spec doc/version.page tests/test-json.c Branch: debian https://github.com/mongodb/libbson/commit/69ae5fa4d8aefc296d36e251526cdad53ecd877a
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

        Message: Merge branch '1.2.0-dev'

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'} Message: Merge branch '1.2.0-dev' 1.2.0-dev: (40 commits) CDRIVER-902 : 1.2.0-rc0 Build failure on Solaris post-release bump 1.2.0-rc0 Release CDRIVER-697 enable BSON_ASSERT in release build CDRIVER-697 delete bson_return macros CDRIVER-697 don't use bson_return_if macros CDRIVER-760 : Add mac os into list of supported os in libbson readme.md CDRIVER-760 : We also support OSX CDRIVER-832 add bson_get_version / check_version CDRIVER-812 notes about bson_t initialization spelling typo in bson_utf8_validate.page style in bson_copy_to.page CDRIVER-712 bson-endian.h should not include bson-types.h. style in bson_uint32_to_string.page CDRIVER-698 fix BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES config missing test.json file add 1.1.7 release to NEWS on 1.2.0-dev ensure CMake defines config vars to 0 or 1 (cherry picked from commit 3048353) CDRIVER-700 unchecked err in bson_utf8_escape_for_json (cherry picked from commit c48a8fc) ... Branch: debian https://github.com/mongodb/libbson/commit/ac3b2a1c5b06b0dcad8e987a14ea89414dcef6a3
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

        Message: CDRIVER-700 unchecked err in bson_utf8_escape_for_json
        Branch: 1.3.0-dev
        https://github.com/mongodb/libbson/commit/c48a8fc9d8216e59120578fa5dbc1c6774efaf47

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'} Message: CDRIVER-700 unchecked err in bson_utf8_escape_for_json Branch: 1.3.0-dev https://github.com/mongodb/libbson/commit/c48a8fc9d8216e59120578fa5dbc1c6774efaf47
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

        Message: Merge branch 'master' into 1.2.0-dev

        • master: (24 commits)
          1.1.11 Release
          CDRIVER-690 fix typo in error check
          CDRIVER-690 fix streaming example to use fd
          CDRIVER-690 clarify callback description
          CDRIVER-690 fix indentation and style
          CDRIVER-690 add BSON streaming read example
          CDRIVER-690 document bson_reader callbacks
          post-release bump
          1.1.10 Release
          post-release bump
          1.1.9 Release
          CDRIVER-727 actually enable coverage in libbson
          post-release bump
          1.1.8 Release
          post-release bump
          1.1.7 Release
          ensure CMake defines config vars to 0 or 1
          CDRIVER-700 unchecked err in bson_utf8_escape_for_json
          fix assert in test_bson_json_read_bad_cb
          %g prints with 3 exp digits by default on windows
          ...

        Conflicts:
        CMakeLists.txt
        NEWS
        build/autotools/Versions.m4
        build/rpm/libbson.spec
        doc/version.page
        tests/test-json.c
        Branch: 1.3.0-dev
        https://github.com/mongodb/libbson/commit/69ae5fa4d8aefc296d36e251526cdad53ecd877a

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'} Message: Merge branch 'master' into 1.2.0-dev master: (24 commits) 1.1.11 Release CDRIVER-690 fix typo in error check CDRIVER-690 fix streaming example to use fd CDRIVER-690 clarify callback description CDRIVER-690 fix indentation and style CDRIVER-690 add BSON streaming read example CDRIVER-690 document bson_reader callbacks post-release bump 1.1.10 Release post-release bump 1.1.9 Release CDRIVER-727 actually enable coverage in libbson post-release bump 1.1.8 Release post-release bump 1.1.7 Release ensure CMake defines config vars to 0 or 1 CDRIVER-700 unchecked err in bson_utf8_escape_for_json fix assert in test_bson_json_read_bad_cb %g prints with 3 exp digits by default on windows ... Conflicts: CMakeLists.txt NEWS build/autotools/Versions.m4 build/rpm/libbson.spec doc/version.page tests/test-json.c Branch: 1.3.0-dev https://github.com/mongodb/libbson/commit/69ae5fa4d8aefc296d36e251526cdad53ecd877a
        Hide
        xgen-internal-githook Githook User added a comment -

        Author:

        {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

        Message: Merge branch '1.2.0-dev'

        Show
        xgen-internal-githook Githook User added a comment - Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'} Message: Merge branch '1.2.0-dev' 1.2.0-dev: (40 commits) CDRIVER-902 : 1.2.0-rc0 Build failure on Solaris post-release bump 1.2.0-rc0 Release CDRIVER-697 enable BSON_ASSERT in release build CDRIVER-697 delete bson_return macros CDRIVER-697 don't use bson_return_if macros CDRIVER-760 : Add mac os into list of supported os in libbson readme.md CDRIVER-760 : We also support OSX CDRIVER-832 add bson_get_version / check_version CDRIVER-812 notes about bson_t initialization spelling typo in bson_utf8_validate.page style in bson_copy_to.page CDRIVER-712 bson-endian.h should not include bson-types.h. style in bson_uint32_to_string.page CDRIVER-698 fix BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES config missing test.json file add 1.1.7 release to NEWS on 1.2.0-dev ensure CMake defines config vars to 0 or 1 (cherry picked from commit 3048353) CDRIVER-700 unchecked err in bson_utf8_escape_for_json (cherry picked from commit c48a8fc) ... Branch: 1.3.0-dev https://github.com/mongodb/libbson/commit/ac3b2a1c5b06b0dcad8e987a14ea89414dcef6a3

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 15 weeks, 3 days ago
              Date of 1st Reply:

                Agile