← Commit list

fe78d70ec

Denys Vlasenko
Denys Vlasenko
2021-03-16
SUCCESS Duration: 152s

Subject

udhcpc: ignore zero-length DHCP options, take 2

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/udhcp/common.c+3 -3
@@ -282,11 +282,11 @@ uint8_t* FAST_FUNC udhcp_scan_options(struct dhcp_packet *packet, struct dhcp_sc
* (this violates RFC 2132 section 3.14).
*/
if (len == 0) {
- scan_state->rem -= OPT_LEN;
- scan_state->optionptr += OPT_LEN;
+ scan_state->rem -= 2;
+ scan_state->optionptr += 2;
continue;
}
- len += OPT_LEN;
+ len += 2;
scan_state->rem -= len;
if (scan_state->rem < 0) /* option is longer than options field? */
goto complain; /* yes, complain and return NULL */