opensmtpd: hotfix stack smashing.

This commit is contained in:
Leah Neukirchen 2020-05-20 18:15:54 +02:00
parent 1b95f80583
commit af067b2d14
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,24 @@
Else it smashes the stack when IPv6 is used.
--- smtpd/mta_session.c
+++ smtpd/mta_session.c
@@ -1811,15 +1811,15 @@
static void
mta_connected(struct mta_session *s)
{
- struct sockaddr sa_src;
- struct sockaddr sa_dest;
+ struct sockaddr_storage sa_src;
+ struct sockaddr_storage sa_dest;
int sa_len;
log_info("%016"PRIx64" mta connected", s->id);
- if (getsockname(io_fileno(s->io), &sa_src, &sa_len) == -1)
+ if (getsockname(io_fileno(s->io), (struct sockaddr *)(void *)&sa_src, &sa_len) == -1)
bzero(&sa_src, sizeof sa_src);
- if (getpeername(io_fileno(s->io), &sa_dest, &sa_len) == -1)
+ if (getpeername(io_fileno(s->io), (struct sockaddr *)(void *)&sa_dest, &sa_len) == -1)
bzero(&sa_dest, sizeof sa_dest);
mta_report_link_connect(s,

View File

@ -1,7 +1,7 @@
# Template file for 'opensmtpd'
pkgname=opensmtpd
version=6.7.0p1
revision=1
revision=2
build_style=gnu-configure
configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin
--with-path-socket=/run --with-path-pidfile=/run