[CDRIVER-485] Invalid read on authentication failure Created: 19/Dec/14  Updated: 19/Oct/16  Resolved: 19/Dec/14

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.0

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When PLAIN authentication fails the reply is freed before the errormsg is copied.

==9140== Invalid read of size 1
==9140== at 0x63869E3: vfprintf (vfprintf.c:1642)
==9140== by 0x63B2C48: vsnprintf (vsnprintf.c:119)
==9140== by 0x77514FD: bson_vsnprintf (bson-string.c:620)
==9140== by 0x77459D6: bson_set_error (bson-error.c:74)
==9140== by 0x775E536: _mongoc_cluster_auth_node_plain (mongoc-cluster.c:1649)
==9140== by 0x775F052: _mongoc_cluster_auth_node (mongoc-cluster.c:1888)
==9140== by 0x775F406: _mongoc_cluster_reconnect_direct (mongoc-cluster.c:1985)
==9140== by 0x77606CE: _mongoc_cluster_reconnect (mongoc-cluster.c:2410)
==9140== by 0x775C0FA: _mongoc_cluster_preselect (mongoc-cluster.c:881)
==9140== by 0x7758662: _mongoc_client_preselect (mongoc-client.c:1158)
==9140== by 0x77851E5: _mongoc_write_command_execute (mongoc-write-command.c:773)
==9140== by 0x7756239: mongoc_bulk_operation_execute (mongoc-bulk-operation.c:339)
==9140== Address 0x7e48e96 is 38 bytes inside a block of size 64 free'd
==9140== at 0x4C2BE10: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9140== by 0x8C264D: _efree (zend_alloc.c:2437)
==9140== by 0x7792E90: php_phongo_free (php_phongo.c:1358)
==9140== by 0x774EFBF: bson_free (bson-memory.c:216)
==9140== by 0x77434F1: bson_destroy (bson.c:2153)
==9140== by 0x775E507: _mongoc_cluster_auth_node_plain (mongoc-cluster.c:1648)
==9140== by 0x775F052: _mongoc_cluster_auth_node (mongoc-cluster.c:1888)
==9140== by 0x775F406: _mongoc_cluster_reconnect_direct (mongoc-cluster.c:1985)
==9140== by 0x77606CE: _mongoc_cluster_reconnect (mongoc-cluster.c:2410)
==9140== by 0x775C0FA: _mongoc_cluster_preselect (mongoc-cluster.c:881)
==9140== by 0x7758662: _mongoc_client_preselect (mongoc-client.c:1158)
==9140== by 0x77851E5: _mongoc_write_command_execute (mongoc-write-command.c:773)
==9140==



 Comments   
Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'samantharitter', u'name': u'Samantha Ritter', u'email': u'samantha.ritter@10gen.com'}

Message: SDAM: port over missed changes from master:

Comment by Githook User [ 11/Mar/15 ]

Author:

{u'username': u'samantharitter', u'name': u'Samantha Ritter', u'email': u'samantha.ritter@10gen.com'}

Message: SDAM: port over missed changes from master:

Comment by Githook User [ 19/Dec/14 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@mongodb.com'}

Message: CDRIVER-485: Invalid read on authentication failure

Closes #141
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/cbe6b337bac2c45f245eadc0f61759912b4471a0

Generated at Wed Feb 07 21:09:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.