mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
image-policy: Fix strv size calculation
We want the logarithm of the next power of two, which is the same as the mask + 1, so add one to the mask to make sure the size is sufficient to fit all flags.
This commit is contained in:
parent
c5730846fe
commit
11781f37ac
@ -376,7 +376,7 @@ int image_policy_from_string(const char *s, ImagePolicy **ret) {
|
||||
|
||||
int partition_policy_flags_to_string(PartitionPolicyFlags flags, bool simplify, char **ret) {
|
||||
_cleanup_free_ char *buf = NULL;
|
||||
const char *l[CONST_LOG2U(_PARTITION_POLICY_MASK) + 1]; /* one string per known flag at most */
|
||||
const char *l[CONST_LOG2U(_PARTITION_POLICY_MASK + 1) + 1]; /* one string per known flag at most */
|
||||
size_t m = 0;
|
||||
|
||||
assert(ret);
|
||||
|
Loading…
Reference in New Issue
Block a user