aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHeinrich Schuchardt2024-04-23 09:09:44 +0200
committerTom Rini2024-05-03 12:22:58 -0600
commite69b187486e3b8124af966d2f20c55c8605ea1ae (patch)
treebcf37f566e90fe71cd6a196047e6494936afa18a /net
parent914b766a2a6b0f746b2e6fe3bf3d70881e6da610 (diff)
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: 8ab388bfdbcf ("net: add support to parse the NIS domain for the dhcp options") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bootp.c b/net/bootp.c
index c15472f5d37..86c56803c76 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -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;
}