Fix double free of InterfaceList (#1669298)

This commit is contained in:
Pavel Zhukov 2019-01-27 18:34:51 +01:00
parent 0c20185664
commit 3681027dea
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,23 @@
From fb1529d0573d3d9744a0e9fea8dd0becfc91ad85 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 24 Jan 2019 13:21:55 +0100
Subject: [PATCH] Fix double-free scenario in case if duplicate interface was
specified (Fixes #100).
Signed-off-by: Pavel Zhukov <pzhukov@redhat.com>
---
gram.y | 1 +
1 file changed, 1 insertion(+)
diff --git a/gram.y b/gram.y
index 5db3bde..20af2f3 100644
--- a/gram.y
+++ b/gram.y
@@ -958,6 +958,7 @@ struct Interface * readin_config(char const *path)
if (yyparse() != 0) {
free_ifaces(iface);
iface = 0;
+ IfaceList = 0;
} else {
dlog(LOG_DEBUG, 1, "config file, %s, syntax ok", path);
}

View File

@ -1,7 +1,7 @@
Summary: A Router Advertisement daemon
Name: radvd
Version: 2.17
Release: 16%{?dist}
Release: 17%{?dist}
# The code includes the advertising clause, so it's GPL-incompatible
License: BSD with advertising
Group: System Environment/Daemons
@ -14,6 +14,7 @@ Patch0: radvd-werror.patch
Patch1: radvd-endianess.patch
Patch2: radvd-stderr_logging.patch
Patch3: radvd-nodaemon_manpage,patch
Patch4: radvd-double_free_ifacelist.patch
BuildRequires: gcc
BuildRequires: bison
@ -42,6 +43,7 @@ services.
%patch1 -p1 -b .endianess
%patch2 -p1 -b .stderr
%patch3 -p1 -b .nodaemon
%patch4 -p1 -b .ifacelist
for F in CHANGES; do
iconv -f iso-8859-1 -t utf-8 < "$F" > "${F}.new"
@ -104,6 +106,9 @@ exit 0
%{_sbindir}/radvdump
%changelog
* Sun Jan 27 2019 Pavel Zhukov <pzhukov@redhat.com> - 2.17-17
- Fix double-free in InterfaceList
* Tue Nov 27 2018 Pavel Zhukov <pzhukov@redhat.com> - 2.17-16
- Depends on network-online target (#1652459)