Skip to content

fixed handling of other cursor errors in mongoc_collection_find_indexes #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

cschwarz-inco
Copy link
Contributor

@cschwarz-inco cschwarz-inco commented Jul 25, 2016

previous behavior: function returned freed cursor if an error different from the two hardcoded error cases occurred. caller then ran into a "use-after-free" issue.

new behavior: functions returns a NULL pointer if an error different from the two hardcoded error cases occurred

@ajdavis
Copy link
Member

ajdavis commented Jul 26, 2016

Good catch. Was there a specific case that reproduced the bug for you?

@cschwarz-inco
Copy link
Contributor Author

It was coincidence. Due to a programming error in our application, multiple threads used the same mongoc_client_t connection concurrently. This caused all kinds of funny errors.

@ajdavis
Copy link
Member

ajdavis commented Jul 26, 2016

Did you mean to push another commit to this PR? It's not related to your first change.

@cschwarz-inco
Copy link
Contributor Author

No I didn't. The second commit was not supposed to go into the first pull request. (maybe a second pull request). I'll try to restore the original pull request...

@cschwarz-inco
Copy link
Contributor Author

Ok. I removed the second commit.

@ajdavis
Copy link
Member

ajdavis commented Jul 27, 2016

Filed the bug:

https://jira.mongodb.org/browse/CDRIVER-1420

I've written a test, awaiting my colleagues' review.

@ajdavis
Copy link
Member

ajdavis commented Jul 27, 2016

Merged in 542c42d.

@ajdavis ajdavis closed this Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants