mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
libsystemd-network: add assert about packet length
We reject too-short packets in client_receive_message_raw(), so the packets that dhcp_packet_verify_headers() gets are of sufficient size. But let's add an assert to clarify this for the reader. Closes #23223.
This commit is contained in:
@@ -129,6 +129,7 @@ int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum, ui
|
||||
size_t hdrlen;
|
||||
|
||||
assert(packet);
|
||||
assert(len >= sizeof(DHCPPacket));
|
||||
|
||||
/* IP */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user