[systemd-devel] [PATCH 1/6] libsystemd-dhcp: DNS name option must be a multiple of 4 bytes

Patrik Flykt patrik.flykt at linux.intel.com
Fri Jan 31 01:31:20 PST 2014


---
 src/libsystemd-dhcp/sd-dhcp-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c b/src/libsystemd-dhcp/sd-dhcp-client.c
index 3b7b9f4..1fdc01a 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-client.c
@@ -775,7 +775,7 @@ static int client_parse_offer(uint8_t code, uint8_t len, const uint8_t *option,
                 break;
 
         case DHCP_OPTION_DOMAIN_NAME_SERVER:
-                if (len >= 4) {
+                if (len && !(len % 4)) {
                         unsigned i;
 
                         lease->dns_size = len / 4;
-- 
1.8.5.2



More information about the systemd-devel mailing list