Skip to content

Commit

Permalink
send-email: don't call methods on undefined values
Browse files Browse the repository at this point in the history
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
bk2204 authored and gitster committed Sep 10, 2013
1 parent 07b83b5 commit 6cb0c88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ sub send_message {
if ($smtp->code == 220) {
$smtp = Net::SMTP::SSL->start_SSL($smtp,
ssl_verify_params())
or die "STARTTLS failed! ".$smtp->message;
or die "STARTTLS failed! ".IO::Socket::SSL::errstr();
$smtp_encryption = '';
# Send EHLO again to receive fresh
# supported commands
Expand Down

0 comments on commit 6cb0c88

Please sign in to comment.