[CSHARP-3297] JsonScanner.GetNextToken() never returns with incomplete regular expressions Created: 30/Dec/20 Updated: 28/Oct/23 Resolved: 19/Feb/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Json |
| Affects Version/s: | None |
| Fix Version/s: | 2.12.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Ryan Kyser | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Description |
|
In the following example, jsonReader.ReadBsonType() will never return.
The problem resides within JsonScanner.GetRegularExpressionToken() as it doesn't account for a -1 return code from buffer.Read() during the RegularExpressionState.InPattern state. GetRegularExpressionToken() will spin indefinitely without yielding. This can be fixed with a single line:
I will be submitting a pull request soon. |
| Comments |
| Comment by Githook User [ 19/Feb/21 ] |
|
Author: {'name': 'Ryan Kyser', 'email': 'ryan.kyser@avasure.com'}Message: |
| Comment by James Kovacs [ 22/Jan/21 ] |
|
Hi, Ryan, This ticket was closed in error by an automated process as it doesn't see conversations on GitHub PRs. I've re-opened the issue while you and rstam work through any remaining issues/questions on your PR. Thank you for your contribution! James |
| Comment by Ryan Kyser [ 22/Jan/21 ] |
|
Hi there! I saw that this was closed. There is an open pull request that I have been working on with Robert Stam. I don't know what your process is, but does it make sense to keep this open until that pull request is resolved? Thanks! |
| Comment by Backlog - Core Eng Program Management Team [ 22/Jan/21 ] |
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. |
| Comment by Ryan Kyser [ 30/Dec/20 ] |
|
Pull request: https://github.com/mongodb/mongo-csharp-driver/pull/430 |