From: Robin H. Johnson Date: Thu, 26 Apr 2007 02:37:20 +0000 (-0700) Subject: Validate @recipients before using it for sendmail and Net::SMTP. X-Git-Tag: v1.5.1.3~29 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c38f0247a88f2c54c0c8535d645f33140201522f;p=git.git Validate @recipients before using it for sendmail and Net::SMTP. Ensure that @recipients is only raw addresses when it is handed to the sendmail binary OR Net::SMTP, otherwise BCC cases might get an extra <, or wierd stuff might be passed to the exec. Signed-off-by: Robin H. Johnson Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index e4fe8965b..b60229290 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -449,6 +449,7 @@ sub send_message @cc = (map { sanitize_address_rfc822($_) } @cc); my $to = join (",\n\t", @recipients); @recipients = unique_email_list(@recipients,@cc,@bcclist); + @recipients = (map { extract_valid_address($_) } @recipients); my $date = format_2822_time($time++); my $gitversion = '@@GIT_VERSION@@'; if ($gitversion =~ m/..GIT_VERSION../) { @@ -474,7 +475,7 @@ X-Mailer: git-send-email $gitversion $header .= join("\n", @xh) . "\n"; } - my @sendmail_parameters = ('-i', map { extract_valid_address($_) } @recipients); + my @sendmail_parameters = ('-i', @recipients); if ($dry_run) { # We don't want to send the email.