summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-10-11 15:25:13 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2021-10-11 15:25:13 +0100
commit68d0c019bace3e1d956ea54d4c5276b8c45b6c1d (patch)
tree666dcc57c51c9a3aa72672f64339a95e21ac9f18
parenta522411280b4f851587511c26ea620481a11660e (diff)
tidying
-rw-r--r--src/src/smtp_out.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c
index 4e8c44869..2147750af 100644
--- a/src/src/smtp_out.c
+++ b/src/src/smtp_out.c
@@ -27,7 +27,7 @@ Arguments:
which case the function does nothing
host_af AF_INET or AF_INET6 for the outgoing IP address
addr the mail address being handled (for setting errors)
- interface point this to the interface
+ interface point this to the interface if there is one defined
msg to add to any error message
Returns: TRUE on success, FALSE on failure, with error message
@@ -64,11 +64,10 @@ if (is_tainted2(expint, LOG_MAIN|LOG_PANIC, "Tainted value '%s' from '%s' for in
Uskip_whitespace(&expint);
if (!*expint) return TRUE;
-/* we just tested to ensure no taint, so big_buffer is ok */
-while ((iface = string_nextinlist(&expint, &sep, big_buffer,
- big_buffer_size)))
+while ((iface = string_nextinlist(&expint, &sep, NULL, 0)))
{
- if (string_is_ip_address(iface, NULL) == 0)
+ int if_af = string_is_ip_address(iface, NULL);
+ if (if_af == 0)
{
addr->transport_return = PANIC;
addr->message = string_sprintf("\"%s\" is not a valid IP "
@@ -77,11 +76,11 @@ while ((iface = string_nextinlist(&expint, &sep, big_buffer,
return FALSE;
}
- if (((Ustrchr(iface, ':') == NULL)? AF_INET:AF_INET6) == host_af)
+ if ((if_af == 4 ? AF_INET : AF_INET6) == host_af)
break;
}
-if (iface) *interface = string_copy(iface);
+*interface = iface;
return TRUE;
}