Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n-dhcp4-client: check broadcast_mac field in n_dhcp4_client_config_set_broadcast_mac() #36

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/n-dhcp4-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ _c_public_ void n_dhcp4_client_config_set_mac(NDhcp4ClientConfig *config, const
_c_public_ void n_dhcp4_client_config_set_broadcast_mac(NDhcp4ClientConfig *config, const uint8_t *mac, size_t n_mac) {
config->n_broadcast_mac = n_mac;

if (n_mac > sizeof(config->mac))
n_mac = sizeof(config->mac);
if (n_mac > sizeof(config->broadcast_mac))
n_mac = sizeof(config->broadcast_mac);

memcpy(config->broadcast_mac, mac, n_mac);
}
Expand Down