opensmtpd: hotfix stack smashing.
This commit is contained in:
parent
1b95f80583
commit
af067b2d14
2 changed files with 25 additions and 1 deletions
24
srcpkgs/opensmtpd/patches/sockaddr.patch
Normal file
24
srcpkgs/opensmtpd/patches/sockaddr.patch
Normal 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,
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'opensmtpd'
|
# Template file for 'opensmtpd'
|
||||||
pkgname=opensmtpd
|
pkgname=opensmtpd
|
||||||
version=6.7.0p1
|
version=6.7.0p1
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin
|
configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin
|
||||||
--with-path-socket=/run --with-path-pidfile=/run
|
--with-path-socket=/run --with-path-pidfile=/run
|
||||||
|
|
Loading…
Reference in a new issue