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 |
62919,7 | JVMCBC-326: Fix parsing of json strings ending with 2 backslashes | master | couchbase-jvm-core | Status: MERGED | +2 | +1 |
63471,2 | JVMCBC-326: Fix parsing of json strings ending with 2 backslashes | release12 | couchbase-jvm-core | Status: MERGED | +2 | +1 |