1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-08 08:58:27 +03:00

sd-dhcp-client: client ID always has non-zero data

Follow-up for f04c991a2fbb3531c3b464ed8e6dd7543e521f7a.
Fixes CID#1510978.
This commit is contained in:
Yu Watanabe 2023-05-09 17:57:33 +09:00 committed by Luca Boccassi
parent c093bfe0ad
commit 251ca88230

View File

@ -346,7 +346,7 @@ int sd_dhcp_client_get_client_id(
assert_return(client, -EINVAL);
if (client->client_id_len > 0) {
if (client->client_id_len < offsetof(sd_dhcp_client_id, raw.data))
if (client->client_id_len <= offsetof(sd_dhcp_client_id, raw.data))
return -EINVAL;
if (ret_type)