Fix freed memory access

This commit is contained in:
Tomas Korbar 2023-05-25 15:02:21 +02:00
parent ecc0e9b344
commit 8d9e3a48bb
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
commit a53fb4c34c8dc09e81ed0577df51a11bc5b7ae3e
Author: Tomas Korbar <tkorbar@redhat.com>
Date: Thu May 25 14:59:46 2023 +0200
Fix freed memory access in posttls-finger
diff --git a/src/posttls-finger/posttls-finger.c b/src/posttls-finger/posttls-finger.c
index 2f3a58e..d446583 100644
--- a/src/posttls-finger/posttls-finger.c
+++ b/src/posttls-finger/posttls-finger.c
@@ -1590,12 +1590,12 @@ static char *parse_destination(char *destination, char *def_service,
static void connect_remote(STATE *state, char *dest)
{
DNS_RR *addr;
- char *buf;
- char *domain;
- char *service;
/* When reconnecting use IP address of previous session */
if (state->addr == 0) {
+ char *buf;
+ char *domain;
+ char *service;
buf = parse_destination(dest, state->smtp ? "smtp" : "24",
&domain, &service, &state->port);
if (!state->nexthop)
@@ -1622,8 +1622,8 @@ static void connect_remote(STATE *state, char *dest)
if (level == TLS_LEV_INVALID
|| (state->stream = connect_addr(state, addr)) == 0) {
- msg_info("Failed to establish session to %s:%s via %s:%u: %s",
- dest, service, HNAME(addr), addr->port,
+ msg_info("Failed to establish session to %s via %s:%u: %s",
+ dest, HNAME(addr), addr->port,
vstring_str(state->why->reason));
continue;
}

View File

@ -49,7 +49,7 @@
Name: postfix
Summary: Postfix Mail Transport Agent
Version: 3.8.0
Release: 2%{?dist}
Release: 3%{?dist}
Epoch: 2
URL: http://www.postfix.org
License: (IBM and GPLv2+) or (EPL-2.0 and GPLv2+)
@ -100,6 +100,8 @@ Patch10: pflogsumm-1.1.5-ipv6-warnings-fix.patch
Patch11: postfix-3.4.4-chroot-example-fix.patch
# rhbz#1931403, sent upstream
Patch13: pflogsumm-1.1.5-syslog-name-underscore-fix.patch
# fix freed memory access reported and fixed by upstream after 3.8.0
Patch14: postfix-3.8.0-posttls-finger.patch
# Optional patches - set the appropriate environment variables to include
# them when building the package/spec file
@ -804,6 +806,9 @@ fi
%endif
%changelog
* Thu May 25 2023 Tomas Korbar <tkorbar@redhat.com> - 2:3.8.0-3
- Fix freed memory access
* Wed Apr 26 2023 Jaroslav Škarvada <jskarvad@redhat.com> - 2:3.8.0-2
- Dropped whitespace-name-fix patch, not needed