summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorekleezg <[email protected]>2025-05-20 14:19:56 +0900
committerekleezg <[email protected]>2025-05-20 14:19:56 +0900
commitadbb3a231a04567da8db6010836664b3da242adb (patch)
tree4a209c2b0ef604ceafb8f11949e77adbe56dd223
parentcd34ed2ab2285b17ff3336ab566b9322d08d06ba (diff)
Insert a index position check before getting bytes
-rw-r--r--addons/dhcp/nxd_dhcpv6_client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/dhcp/nxd_dhcpv6_client.c b/addons/dhcp/nxd_dhcpv6_client.c
index 7486fe66..e7ffa741 100644
--- a/addons/dhcp/nxd_dhcpv6_client.c
+++ b/addons/dhcp/nxd_dhcpv6_client.c
@@ -5811,6 +5811,12 @@ ULONG temp_lsw = 0;
index += 4;
}
+ /* Check option length for 4 bytes lsw. */
+ if (index + 4 > option_length)
+ {
+ return(NX_DHCPV6_INVALID_SERVER_DUID);
+ }
+
/* Yes; Extract the link local address lsw which should be the next 4 bytes. */
_nx_dhcpv6_utility_get_data((option_data + index), 4, &temp_lsw);