mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 14:40:31 +00:00
image-policy: Fix size assertion
We're going to write a null pointer to l[m] so we need to make sure m is smaller than the size of the array, not m + 1.
This commit is contained in:
@@ -437,7 +437,7 @@ int partition_policy_flags_to_string(PartitionPolicyFlags flags, bool simplify,
|
||||
if (m == 0)
|
||||
buf = strdup("-");
|
||||
else {
|
||||
assert(m+1 < ELEMENTSOF(l));
|
||||
assert(m < ELEMENTSOF(l));
|
||||
l[m] = NULL;
|
||||
|
||||
buf = strv_join((char**) l, "+");
|
||||
|
||||
Reference in New Issue
Block a user