mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 10:13:34 +08:00
network/address: do not set family in config_parse_broadcast()
The family will be checked later in
address_section_verify() -> address_section_adjust_broadcast(),
hence it is not necessary to set here.
Follow-up for 5d15c7b19c
.
Fixes oss-fuzz#372994449.
Fixes #34748.
This commit is contained in:
parent
709fdcc75a
commit
6f639b2555
@ -2033,9 +2033,12 @@ static int config_parse_broadcast(
|
||||
union in_addr_union u;
|
||||
int r;
|
||||
|
||||
/* Do not check or set address->family here. It will be checked later in
|
||||
* address_section_verify() -> address_section_adjust_broadcast() . */
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
/* The broadcast address will be calculated based on Address=, and set if the link is
|
||||
* not a wireguard interface. Here, we do not check or set address->family. */
|
||||
* not a wireguard interface. */
|
||||
address->broadcast = (struct in_addr) {};
|
||||
address->set_broadcast = -1;
|
||||
return 1;
|
||||
@ -2043,8 +2046,7 @@ static int config_parse_broadcast(
|
||||
|
||||
r = parse_boolean(rvalue);
|
||||
if (r >= 0) {
|
||||
/* The broadcast address will be calculated based on Address=. Here, we do not check or
|
||||
* set address->family. */
|
||||
/* The broadcast address will be calculated based on Address=. */
|
||||
address->broadcast = (struct in_addr) {};
|
||||
address->set_broadcast = r;
|
||||
return 1;
|
||||
@ -2061,7 +2063,6 @@ static int config_parse_broadcast(
|
||||
|
||||
address->broadcast = u.in;
|
||||
address->set_broadcast = true;
|
||||
address->family = AF_INET;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
BIN
test/fuzz/fuzz-network-parser/oss-fuzz-372994449
Normal file
BIN
test/fuzz/fuzz-network-parser/oss-fuzz-372994449
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user