Meet taint mode requirements for handling test SMTP port
authorJacob Bachmeyer <jcb@gnu.org>
Sun, 14 Nov 2021 01:08:28 +0000 (19:08 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Sun, 14 Nov 2021 01:08:28 +0000 (19:08 -0600)
upload-ftp-v1.2.pl

index 02417c769a1e0ae2fb43b206c45719124541f964..b59b71f0e44ed1fb22286b26677f9edb2780d554 100755 (executable)
@@ -271,7 +271,8 @@ if (IN_TEST_MODE) { # override the above for testing
   }
   # verify configuration for mock smtpd
   die "ftp-upload: test mode: TEST_SMTP_PORT not valid"
-    unless $ENV{TEST_SMTP_PORT} && $ENV{TEST_SMTP_PORT} =~ m/^\d+$/;
+    unless $ENV{TEST_SMTP_PORT} && $ENV{TEST_SMTP_PORT} =~ m/^(\d+)$/;
+  $ENV{TEST_SMTP_PORT} = $1;   # untaint the test SMTP port number
   # verify configuration for mock syslog
   die "ftp-upload: test mode: TEST_SYSLOG_SOCKET not valid"
     unless $ENV{TEST_SYSLOG_SOCKET} && -S $ENV{TEST_SYSLOG_SOCKET} && -w _;