diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 530ac7e758..82633d4ee6 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -277,7 +277,8 @@ public: options[next_option_offset++] = (u8)option; memcpy(options + next_option_offset, &length, 1); next_option_offset++; - memcpy(options + next_option_offset, data, length); + if (data && length) + memcpy(options + next_option_offset, data, length); next_option_offset += length; }