diff options
| author | Roy Marples <roy@marples.name> | 2016-06-01 05:44:22 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-06-01 05:44:22 +0000 |
| commit | 77f0b46ed38e2dca5f663de2e3cb230d33ebaffb (patch) | |
| tree | 335ae12fc60def00fbc0c56b700345bd88d1dece /dhcp.c | |
| parent | a2af95d72dea4ee7d5369c210247efae98aca05f (diff) | |
| download | dhcpcd-77f0b46ed38e2dca5f663de2e3cb230d33ebaffb.tar.xz | |
We can work with saved leases without a full vendor area.
Diffstat (limited to 'dhcp.c')
| -rw-r--r-- | dhcp.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1165,7 +1165,12 @@ read_lease(struct interface *ifp, struct bootp **bootp) return 0; } - if (bytes < sizeof(**bootp)) { + /* Ensure the packet is at lease BOOTP sized + * with a vendor area of 4 octets + * (it should be more, and our read packet enforces this so this + * code should not be needed, but of course people could + * scribble whatever in the stored lease file. */ + if (bytes < offsetof(struct bootp, vend) + 4) { free(lease); logger(ifp->ctx, LOG_ERR, "%s: truncated lease", __func__); return 0; |
