Skip to content

Commit 6cb0c88

Browse files
bk2204gitster
authored andcommitted
send-email: don't call methods on undefined values
If SSL verification is enabled in git send-email, we could attempt to call a method on an undefined value if the verification failed, since $smtp would end up being undef. Look up the error string in a way that will produce a helpful error message and not cause further errors. Signed-off-by: Brian M. Carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07b83b5 commit 6cb0c88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ sub send_message {
12341234
if ($smtp->code == 220) {
12351235
$smtp = Net::SMTP::SSL->start_SSL($smtp,
12361236
ssl_verify_params())
1237-
or die "STARTTLS failed! ".$smtp->message;
1237+
or die "STARTTLS failed! ".IO::Socket::SSL::errstr();
12381238
$smtp_encryption = '';
12391239
# Send EHLO again to receive fresh
12401240
# supported commands

0 commit comments

Comments
 (0)