[CDRIVER-3523] Some return values not considered in mongoc_stream_tls_openssl_new Created: 05/Feb/20  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: tls
Affects Version/s: 1.16.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: new-eng, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3522 Stack smashing detected connecting to... Closed
Epic Link: CDRIVER-4575

 Description   

While investigating the top stack frame in CDRIVER-3522, I noticed that some return values in mongoc_stream_tls_openssl_new are not considered.

  • inet_pton() may return -1 on error, but the code considers all non-zero return values as success.
  • X509_VERIFY_PARAM_set1_ip_asc and X509_VERIFY_PARAM_set1_host return 1 and 0 for success and failure, respectively.

There may be more issues, but these are just two that stood out to me while walking through the code and I wanted to log an issue to make a note of it.

I'm using 1.16.1 as the affects version here since the code seems to have been unchanged from the older libmongoc version reported in CDRIVER-3522.


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