mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
Merge pull request #12087 from yuwata/fix-condition-free-list
util: fix condition_free_list_type()
This commit is contained in:
commit
fd7887da00
@ -81,7 +81,7 @@ typedef struct NetDev {
|
||||
|
||||
char *filename;
|
||||
|
||||
Condition *conditions;
|
||||
LIST_HEAD(Condition, conditions);
|
||||
|
||||
NetDevState state;
|
||||
NetDevKind kind;
|
||||
|
@ -97,7 +97,7 @@ struct Network {
|
||||
char **match_driver;
|
||||
char **match_type;
|
||||
char **match_name;
|
||||
Condition *conditions;
|
||||
LIST_HEAD(Condition, conditions);
|
||||
|
||||
char *description;
|
||||
|
||||
|
@ -77,17 +77,17 @@ void condition_free(Condition *c) {
|
||||
free(c);
|
||||
}
|
||||
|
||||
Condition* condition_free_list_type(Condition *first, ConditionType type) {
|
||||
Condition *c, *n, *r = NULL;
|
||||
Condition* condition_free_list_type(Condition *head, ConditionType type) {
|
||||
Condition *c, *n;
|
||||
|
||||
LIST_FOREACH_SAFE(conditions, c, n, first)
|
||||
if (type < 0 || c->type == type)
|
||||
LIST_FOREACH_SAFE(conditions, c, n, head)
|
||||
if (type < 0 || c->type == type) {
|
||||
LIST_REMOVE(conditions, head, c);
|
||||
condition_free(c);
|
||||
else if (!r)
|
||||
r = c;
|
||||
}
|
||||
|
||||
assert(type >= 0 || !r);
|
||||
return r;
|
||||
assert(type >= 0 || !head);
|
||||
return head;
|
||||
}
|
||||
|
||||
static int condition_test_kernel_command_line(Condition *c) {
|
||||
|
@ -40,7 +40,7 @@ struct link_config {
|
||||
char **match_driver;
|
||||
char **match_type;
|
||||
char **match_name;
|
||||
Condition *conditions;
|
||||
LIST_HEAD(Condition, conditions);
|
||||
|
||||
char *description;
|
||||
struct ether_addr *mac;
|
||||
|
4
test/fuzz/fuzz-link-parser/oss-fuzz-13878
Normal file
4
test/fuzz/fuzz-link-parser/oss-fuzz-13878
Normal file
@ -0,0 +1,4 @@
|
||||
[Match]
|
||||
KernelVersion=t
|
||||
Virtualization=q
|
||||
KernelVersion=
|
BIN
test/fuzz/fuzz-link-parser/oss-fuzz-13882
Normal file
BIN
test/fuzz/fuzz-link-parser/oss-fuzz-13882
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-13884
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-13884
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-13886
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-13886
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-network-parser/oss-fuzz-13888
Normal file
BIN
test/fuzz/fuzz-network-parser/oss-fuzz-13888
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user