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 edfcb54..1df89dc 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;