teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0142-resolved-remove-inappropriate-assert.patch

ac3a84
From 87b1eac151e5bbb9322d3213072dc2e5fba24f4e Mon Sep 17 00:00:00 2001
ac3a84
From: Lennart Poettering <lennart@poettering.net>
ac3a84
Date: Thu, 24 Nov 2022 18:42:08 +0100
ac3a84
Subject: [PATCH] resolved: remove inappropriate assert()
ac3a84
ac3a84
A NULL Bitmap object is by all our code considered identical to an empty
ac3a84
bitmap. Hence let's remove the entirely unnecessary assert().
ac3a84
ac3a84
The assert() can be triggered if debug monitoring is used an an empty
ac3a84
NSEC or NSEC3 RR is included in an answer resolved returns.
ac3a84
ac3a84
it's not really a security issue since enabling debug monitoring is a
ac3a84
manual step requiring root privileges, that is off by default. Moreover,
ac3a84
it's a "clean" assert(), i.e. the worst that happens is tha a coredump
ac3a84
is generated and resolved restarted.
ac3a84
ac3a84
Fixes: #25449
ac3a84
(cherry picked from commit fb896517aeecc2a8ec16586a34a0249606eb9f66)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 src/resolve/resolved-dns-rr.c | 1 -
ac3a84
 1 file changed, 1 deletion(-)
ac3a84
ac3a84
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
ac3a84
index 8123ca1f98..d47cdbbd8e 100644
ac3a84
--- a/src/resolve/resolved-dns-rr.c
ac3a84
+++ b/src/resolve/resolved-dns-rr.c
ac3a84
@@ -1865,7 +1865,6 @@ static int type_bitmap_to_json(Bitmap *b, JsonVariant **ret) {
ac3a84
         unsigned t;
ac3a84
         int r;
ac3a84
 
ac3a84
-        assert(b);
ac3a84
         assert(ret);
ac3a84
 
ac3a84
         BITMAP_FOREACH(t, b) {