From: Brian M. Carlson Date: Sun, 8 Sep 2013 20:54:34 +0000 (+0000) Subject: send-email: don't call methods on undefined values X-Git-Tag: v1.8.4.1~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cb0c883052118c35e424af7a311c66be9b366e1;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index 2162478392..3782c3b0cb 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1234,7 +1234,7 @@ X-Mailer: git-send-email $gitversion 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