summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-04-14 10:08:31 +0200
committerDavid Tardon <dtardon@redhat.com>2023-04-14 10:16:01 +0200
commitcfc28ee232ce07106137a42d2d467305c00163fe (patch)
treed84f171c874241a19ead7fd21c1b873aac4c38f6 /src
parent088d71f8edd616a839a6ebfd3ab0c58701678757 (diff)
downloadsystemd-cfc28ee232ce07106137a42d2d467305c00163fe.tar.gz
tree-wide: add some asserts
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-etc-hosts.c2
-rw-r--r--src/shared/cpu-set-util.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/resolve/resolved-etc-hosts.c b/src/resolve/resolved-etc-hosts.c
index 5eee9c57b2..6acae48c2b 100644
--- a/src/resolve/resolved-etc-hosts.c
+++ b/src/resolve/resolved-etc-hosts.c
@@ -285,6 +285,8 @@ int etc_hosts_parse(EtcHosts *hosts, FILE *f) {
unsigned nr = 0;
int r;
+ assert(hosts);
+
for (;;) {
_cleanup_free_ char *line = NULL;
char *l;
diff --git a/src/shared/cpu-set-util.c b/src/shared/cpu-set-util.c
index 580aa27c5c..d096576cd6 100644
--- a/src/shared/cpu-set-util.c
+++ b/src/shared/cpu-set-util.c
@@ -145,6 +145,8 @@ int parse_cpu_set_full(
_cleanup_(cpu_set_reset) CPUSet c = {};
const char *p = ASSERT_PTR(rvalue);
+ assert(cpu_set);
+
for (;;) {
_cleanup_free_ char *word = NULL;
unsigned cpu_lower, cpu_upper;
@@ -198,6 +200,8 @@ int parse_cpu_set_extend(
_cleanup_(cpu_set_reset) CPUSet cpuset = {};
int r;
+ assert(old);
+
r = parse_cpu_set_full(rvalue, &cpuset, true, unit, filename, line, lvalue);
if (r < 0)
return r;