[GODRIVER-887] Panic when passing in UploadOptions with Metadata but no Registry to bucket.OpenUploadStream Created: 18/Mar/19  Updated: 28/Oct/23  Resolved: 19/Mar/19

Status: Closed
Project: Go Driver
Component/s: GridFS
Affects Version/s: 1.0.0
Fix Version/s: 1.0.1

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


 Description   

Passing in an UploadOptions specifying Metadata but not Registry to bucket.OpenUploadStream causes the driver to panic due to a nil pointer dereference.

This is due to the options.GridFSUpload constructor not setting the default registry as the docstring suggests, and the lack of a nil check in parseUploadOptions, where the panic actually occurs.



 Comments   
Comment by Githook User [ 19/Mar/19 ]

Author:

{'email': 'patrick.freed@mongodb.com', 'name': 'Patrick Freed', 'username': 'patrickfreed'}

Message: GODRIVER-887 Properly set default registry when using UploadOptions
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/385f1a6b3cc78375b5d3d229bc917fad3b2e1992

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