← Commit list

42202bfb1

Denys Vlasenko
Denys Vlasenko
2026-03-12
SUCCESS Duration: 143s

Subject

udhcpc6: fix buffer overflow

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
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

networking/udhcp/d6_dhcpc.c+3 -3
@@ -369,15 +369,15 @@ static void option_to_env(const uint8_t *option, const uint8_t *option_end)
addrs = option[3] >> 4;
/* Setup environment variable */
- *new_env() = dlist = xmalloc(4 + addrs * 40 - 1);
+ *new_env() = dlist = xmalloc(4 + addrs * 40 + 1);
dlist = stpcpy(dlist, "dns=");
option_offset = 0;
- while (addrs--) {
+ while (addrs-- != 0) {
sprint_nip6(dlist, option + 4 + option_offset);
dlist += 39;
option_offset += 16;
- if (addrs)
+ if (addrs != 0)
*dlist++ = ' ';
}