naccyde / rpms / systemd

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