Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-326

N1QL and view parsers fails when json string terminates with two backslashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.2.8, 1.3.0
    • 1.2.7
    • Core
    • None

    Description

      When looking for row boundaries, the query parser skips overs what it detects as being part of a JSON string. To do so, it tracks the end of strings by looking for a closing quote and checking that it is not preceded by an escaping backslash. The thing is, such a backslash could itself be escaped inside the string by another backslash, and that later case isn't detected, wrongly assuming the inspected quote isn't the closing one.

      For example the following chunk will fail the parser, sending it into an infinite loop in wait of the closing quote at the end.

            {
                  "avgResults": 20,
                  "avgViewed": 20,
                  "count": 1,
                  "nav": "0",
                  "term": "databasenosql\\"
              }
      

      Attachments

        For Gerrit Dashboard: JVMCBC-326
        # Subject Branch Project Status CR V

        Activity

          People

            simonbasle Simon Baslé (Inactive)
            dproctor Dean Proctor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty