[CXX-986] Invalid error handling in find_and_modify - null pointer access Created: 10/Aug/16 Updated: 21/Nov/16 Resolved: 14/Sep/16 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | 3.0.1 |
| Fix Version/s: | 3.0.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Rustam Abdullaev | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
This problem is related to this code in find_and_modify:
If the mongo operation fails at connection level, gle is null, causing null pointer access inside value_from_bson_t(gle). Test case:
|
| Comments |
| Comment by Githook User [ 14/Sep/16 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |
| Comment by Githook User [ 14/Sep/16 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |
| Comment by Andrew Morrow (Inactive) [ 13/Sep/16 ] |
| Comment by Rustam Abdullaev [ 10/Aug/16 ] |
|
Thanks. |
| Comment by David Golden [ 10/Aug/16 ] |
|
PR submitted by reporter as https://github.com/mongodb/mongo-cxx-driver/pull/515 |
| Comment by David Golden [ 10/Aug/16 ] |
|
Opened it as |
| Comment by David Golden [ 10/Aug/16 ] |
|
Thanks for the report. I'm going to open the operation_exception concern as a separate ticket. |
| Comment by Rustam Abdullaev [ 10/Aug/16 ] |
|
In addition, I think the implementation of operation_exception is incomplete; _raw_server_error is stdx::optional<bsoncxx::document::value>, but there is no way to construct operation_exception without a valid bsoncxx::document::value. |