model-writtenrun 4043 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sergey Shinderuk reported a static-analyzer finding of possible pfree(NULL) in be_tls_open_server() and proposed NULL guards plus handling of X509_NAME_print_ex() failures, while observing that RFC2253 escaping appeared to make the embedded-null distinguished-name check unreachable #1.
- Daniel Gustafsson proposed rejecting failed common-name extraction instead #2, but Jacob Champion explained that valid DN-based authentication and certificate authorization can use certificates without common names #3, leading Daniel to favor Sergey's original approach #4.
- Sergey reproduced the crash with a certificate lacking a common name and debugger-induced allocation failures #5; Daniel requested a regression test #6, but Sergey explained that reliably forcing the required malloc failure would prevent a stable, portable test #7.
- Michael Paquier suggested adding a certificate without a common name to broaden SSL coverage #8, Jacob discussed difficulties generating embedded-null certificates #9, and Sergey described his manual certificate-editing procedure and offered to add a certificate lacking a common name #10.
- Daniel proposed landing the original fix while certificate testing remained unresolved #11; Michael supported proceeding but questioned whether X509_NAME_print_ex() errors should abort the connection #12, and Sergey demonstrated that ignoring allocation failure could leave an empty distinguished name #13.
- Daniel checked the supported OpenSSL implementations, confirmed that handling a -1 return was appropriate, and reposted Sergey's original code unchanged with a commit message and a plan to backpatch through PostgreSQL 15 #14; Sergey approved it apart from a commit-message typo #15, which Daniel agreed to fix #16.
- Daniel committed the unchanged code as 5f3aa309a8, with 9dc85806d8 representing the same fix on PostgreSQL 15, then reported successful builds on all three affected branches #17; the proposed certificate-test additions were not included and remained unresolved in this thread.