chiark / gitweb /
sd-dhcp-client: fix memory corruption
authorTom Gundersen <teg@jklm.no>
Thu, 16 Jan 2014 00:40:23 +0000 (01:40 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 16 Jan 2014 00:41:12 +0000 (01:41 +0100)
src/libsystemd/sd-dhcp-client.c

index edfcb54a4c7b4762d219c63934eae8b661c631d5..1df89dc65111d2ece72766bb9e2cce203b8aef96 100644 (file)
@@ -783,7 +783,7 @@ static int client_parse_offer(uint8_t code, uint8_t len, const uint8_t *option,
                                 memcpy(&lease->dns[i]->s_addr, option + 4 * i, 4);
                         }
 
-                        lease->dns[i + 1] = NULL;
+                        lease->dns[len / 4] = NULL;
                 }
 
                 break;