Actions
Bug #11384
closedWt::Mail::Client throws on connect, segfaults on send when not connected
Start date:
02/28/2023
Due date:
% Done:
100%
Estimated time:
Description
The following forum post got me to look at Wt::Mail::Client
: https://redmine.emweb.be/boards/2/topics/18269
I observed the following:
- If the resolver fails,
Client::connect
throws an exception instead of returningfalse
(as documented) - If the client is not connected, and
Client::send
is used, this will result in a null pointer dereference, this can be due to:- the user forgetting to call
connect
- similarly,
send
being called afterdisconnect
connect
being used withTransportEncryption
set to anything other thanNone
, but Wt is built without OpenSSL (Wt will log "TLS requested, but Wt built without OpenSSL").
- the user forgetting to call
I think we should fix the client so:
Client::connect
logs an error and returns false if the resolver fails (matching the documentation)Client::send
logs an error and returns false if the client is not connected
Actions