diff options
| author | russ <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-12-24 19:57:13 +0000 |
|---|---|---|
| committer | russ <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-12-24 19:57:13 +0000 |
| commit | d42e84a5cd47a7c6069d3d53d4aa4878db1bb279 (patch) | |
| tree | ed7384761891f887b9ad5dcc4e1152666c573874 | |
| parent | 1576c03cc36f82a36dad6fdaf021c8c51741d84b (diff) | |
| download | busybox-w32-d42e84a5cd47a7c6069d3d53d4aa4878db1bb279.tar.gz busybox-w32-d42e84a5cd47a7c6069d3d53d4aa4878db1bb279.tar.bz2 busybox-w32-d42e84a5cd47a7c6069d3d53d4aa4878db1bb279.zip | |
fix a long standing underallocation bug
git-svn-id: svn://busybox.net/trunk/busybox@8178 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | networking/udhcp/script.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index 1f74cd742..24688b518 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
| @@ -146,8 +146,11 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
| 146 | num_options = 0; | 146 | num_options = 0; |
| 147 | else { | 147 | else { |
| 148 | for (i = 0; dhcp_options[i].code; i++) | 148 | for (i = 0; dhcp_options[i].code; i++) |
| 149 | if (get_option(packet, dhcp_options[i].code)) | 149 | if (get_option(packet, dhcp_options[i].code)) { |
| 150 | num_options++; | 150 | num_options++; |
| 151 | if (dhcp_options[i].code == DHCP_SUBNET) | ||
| 152 | num_options++; /* for mton */ | ||
| 153 | } | ||
| 151 | if (packet->siaddr) num_options++; | 154 | if (packet->siaddr) num_options++; |
| 152 | if ((temp = get_option(packet, DHCP_OPTION_OVER))) | 155 | if ((temp = get_option(packet, DHCP_OPTION_OVER))) |
| 153 | over = *temp; | 156 | over = *temp; |
| @@ -194,7 +197,7 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
| 194 | /* watch out for invalid packets */ | 197 | /* watch out for invalid packets */ |
| 195 | packet->sname[sizeof(packet->sname) - 1] = '\0'; | 198 | packet->sname[sizeof(packet->sname) - 1] = '\0'; |
| 196 | asprintf(&envp[j++], "sname=%s", packet->sname); | 199 | asprintf(&envp[j++], "sname=%s", packet->sname); |
| 197 | } | 200 | } |
| 198 | return envp; | 201 | return envp; |
| 199 | } | 202 | } |
| 200 | 203 | ||
