knot: update to 3.2.3.

This commit is contained in:
Duncaen 2022-11-21 17:04:57 +01:00
parent 6d0dac8205
commit 09d36c587a
No known key found for this signature in database
GPG key ID: 335C1D17EC3D6E35
2 changed files with 3 additions and 51 deletions

View file

@ -1,48 +0,0 @@
From 8a6645dab63d8fa7932c7d8f747fe33e8cc97e84 Mon Sep 17 00:00:00 2001
From: Daniel Salzman <daniel.salzman@nic.cz>
Date: Sun, 6 Nov 2022 13:43:27 +0100
Subject: [PATCH] knsupdate: fix segfault due to NULL pointer access when
sending an update
---
src/utils/common/netio.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/utils/common/netio.c b/src/utils/common/netio.c
index 2fdb142b4..56017b1b9 100644
--- a/src/utils/common/netio.c
+++ b/src/utils/common/netio.c
@@ -222,6 +222,12 @@ int net_init(const srv_info_t *local,
net->proxy.src = proxy_src;
net->proxy.dst = proxy_dst;
+ if ((bool)(proxy_src == NULL) != (bool)(proxy_dst == NULL) ||
+ (proxy_src != NULL && proxy_src->sa_family != proxy_dst->sa_family)) {
+ net_clean(net);
+ return KNOT_EINVAL;
+ }
+
// Prepare for TLS.
if (tls_params != NULL && tls_params->enable) {
int ret = 0;
@@ -584,7 +590,7 @@ int net_send(const net_t *net, const uint8_t *buf, const size_t buf_len)
.msg_iovlen = 1
};
- if (net->proxy.src->sa_family && net->proxy.dst->sa_family) {
+ if (net->proxy.src != NULL && net->proxy.src->sa_family != 0) {
int ret = proxyv2_write_header(proxy_buf, sizeof(proxy_buf),
SOCK_DGRAM, net->proxy.src,
net->proxy.dst);
@@ -638,7 +644,7 @@ int net_send(const net_t *net, const uint8_t *buf, const size_t buf_len)
.msg_iovlen = 2
};
- if (net->proxy.src->sa_family && net->proxy.dst->sa_family) {
+ if (net->proxy.src != NULL && net->proxy.src->sa_family != 0) {
int ret = proxyv2_write_header(proxy_buf, sizeof(proxy_buf),
SOCK_STREAM, net->proxy.src,
net->proxy.dst);
--
GitLab

View file

@ -1,7 +1,7 @@
# Template file for 'knot' # Template file for 'knot'
pkgname=knot pkgname=knot
version=3.2.2 version=3.2.3
revision=2 revision=1
build_style=gnu-configure build_style=gnu-configure
configure_args=" configure_args="
--disable-silent-rules --disable-silent-rules
@ -20,7 +20,7 @@ license="GPL-3.0-or-later"
homepage="https://www.knot-dns.cz/" homepage="https://www.knot-dns.cz/"
changelog="https://github.com/CZ-NIC/knot/raw/master/NEWS" changelog="https://github.com/CZ-NIC/knot/raw/master/NEWS"
distfiles="https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz" distfiles="https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz"
checksum=cea9c1988cdce7752f88fbe37378f65e83c4e54048978b94fb21a9c92f88788f checksum=f736ef284358923e312f8e1e3c6ce7c97b20965b09eb65705e9f7e3d5e9a9d79
system_accounts="_knot" system_accounts="_knot"
_knot_homedir="/var/lib/knot" _knot_homedir="/var/lib/knot"