aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorBrian Foley <bpfoley@google.com>2016-10-25 14:20:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-10-25 14:20:55 +0200
commitf9beeb22e2a4128ed85a8dc267d0823e5cfd3f47 (patch)
tree6c83a9185531079940b7c5b0d687c253a4bced06 /networking/udhcp/dhcpc.c
parent69312e87b008363575a6d6603f54f94d8150e1cc (diff)
downloadbusybox-w32-f9beeb22e2a4128ed85a8dc267d0823e5cfd3f47.tar.gz
busybox-w32-f9beeb22e2a4128ed85a8dc267d0823e5cfd3f47.tar.bz2
busybox-w32-f9beeb22e2a4128ed85a8dc267d0823e5cfd3f47.zip
udhcpc: check read of option length byte to be within packet
function old new delta udhcp_get_option 215 220 +5 udhcp_run_script 802 803 +1 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index bef73277a..1c1051107 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -450,7 +450,7 @@ static char **fill_envp(struct dhcp_packet *packet)
450 temp = udhcp_get_option(packet, i); 450 temp = udhcp_get_option(packet, i);
451 if (temp) { 451 if (temp) {
452 if (i == DHCP_OPTION_OVERLOAD) 452 if (i == DHCP_OPTION_OVERLOAD)
453 overload = *temp; 453 overload |= *temp;
454 else if (i == DHCP_SUBNET) 454 else if (i == DHCP_SUBNET)
455 envc++; /* for $mask */ 455 envc++; /* for $mask */
456 envc++; 456 envc++;
@@ -476,7 +476,7 @@ static char **fill_envp(struct dhcp_packet *packet)
476 * uint16_t secs; // elapsed since client began acquisition/renewal 476 * uint16_t secs; // elapsed since client began acquisition/renewal
477 * uint16_t flags; // only one flag so far: bcast. Never set by server 477 * uint16_t flags; // only one flag so far: bcast. Never set by server
478 * uint32_t ciaddr; // client IP (usually == yiaddr. can it be different 478 * uint32_t ciaddr; // client IP (usually == yiaddr. can it be different
479 * // if during renew server wants to give us differn IP?) 479 * // if during renew server wants to give us different IP?)
480 * uint32_t gateway_nip; // relay agent IP address 480 * uint32_t gateway_nip; // relay agent IP address
481 * uint8_t chaddr[16]; // link-layer client hardware address (MAC) 481 * uint8_t chaddr[16]; // link-layer client hardware address (MAC)
482 * TODO: export gateway_nip as $giaddr? 482 * TODO: export gateway_nip as $giaddr?