@matheusbsbs / matheus-bagliano / commits / c38f0247a8
Fork 0

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 <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Robin H. Johnson committed Apr 25, 2007 at 19:37 UTC c38f0247a88f2c54c0c8535d645f33140201522f
1 file changed +2 -1
git-send-email.perl
+2 -1
@@ -449,6 +449,7 @@ sub send_message
449 @cc = (map { sanitize_address_rfc822($_) } @cc);
450 my $to = join (",\n\t", @recipients);
451 @recipients = unique_email_list(@recipients,@cc,@bcclist);
452 + @recipients = (map { extract_valid_address($_) } @recipients);
453 my $date = format_2822_time($time++);
454 my $gitversion = '@@GIT_VERSION@@';
455 if ($gitversion =~ m/..GIT_VERSION../) {
@@ -474,7 +475,7 @@ X-Mailer: git-send-email $gitversion
475 $header .= join("\n", @xh) . "\n";
476 }
477
477 - my @sendmail_parameters = ('-i', map { extract_valid_address($_) } @recipients);
478 + my @sendmail_parameters = ('-i', @recipients);
479
480 if ($dry_run) {
481 # We don't want to send the email.