[GODRIVER-700] JSON scanner fails when underlying reader reads less than the requested bytes and also returns io.EOF Created: 13/Dec/18  Updated: 28/Oct/23  Resolved: 15/Dec/18

Status: Closed
Project: Go Driver
Component/s: JSON & ExtJSON
Affects Version/s: None
Fix Version/s: 0.2.0

Type: Bug Priority: Major - P3
Reporter: Craig Wilson Assignee: Craig Wilson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Issue is here: https://github.com/mongodb/mongo-go-driver/blob/6310dd3c4b6b7db65c30139cb2396288e7d6a7e1/bson/bsonrw/json_scanner.go#L100-L104

 

Just because the underying reader returned io.EOF doesn't mean it totally failed. In this case, the gzip.Reader will return EOF and also less than the requested number of bytes, which are still valid bytes.

 



 Comments   
Comment by Githook User [ 14/Dec/18 ]

Author:

{'username': 'craiggwilson', 'email': 'craiggwilson@gmail.com', 'name': 'Craig Wilson'}

Message: GODRIVER-700: fix issue with EOF handling in the json scanner when io.Reader returns n > 0 and io.EOF.

Change-Id: Ibad8c2dcada1f5ea0d88129681cdf1d57f51f9a3
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/8fd342d88c6f94afd611033d2f5ff676537f6b40

Generated at Thu Feb 08 08:34:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.