mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
net: consider option-length when parsing NIS domain
When parsing option 40 (network information service domain) the
option length is in variable 'oplen' and not in 'size'.
Addresses-Coverity-ID: 492765 Uninitialized variables (UNINIT)
Fixes: 8ab388bfdb
("net: add support to parse the NIS domain for the dhcp options")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
914b766a2a
commit
e69b187486
1 changed files with 1 additions and 1 deletions
|
@ -886,7 +886,7 @@ static void dhcp_process_options(uchar *popt, uchar *end)
|
|||
case 40: /* NIS Domain name */
|
||||
if (net_nis_domain[0] == 0) {
|
||||
size = truncate_sz("NIS Domain Name",
|
||||
sizeof(net_nis_domain), size);
|
||||
sizeof(net_nis_domain), oplen);
|
||||
memcpy(&net_nis_domain, popt + 2, size);
|
||||
net_nis_domain[size] = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue