diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-05-03 16:28:41 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-05-04 12:53:34 +0300 |
commit | 0306ba047e5da95fe92219967944f7466e35a492 (patch) | |
tree | 55eb9702f24dfc91cebc1c9100755aea70378b84 /gdhcp | |
parent | 1d1a22fe586a455935483708fbe8eaeada79df7f (diff) | |
download | connman-0306ba047e5da95fe92219967944f7466e35a492.tar.gz connman-0306ba047e5da95fe92219967944f7466e35a492.tar.bz2 connman-0306ba047e5da95fe92219967944f7466e35a492.zip |
gdhcp: Add option and length checks
Diffstat (limited to 'gdhcp')
-rw-r--r-- | gdhcp/client.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index 3d27b4a0..b9f8da61 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -1596,6 +1596,9 @@ static GList *get_addresses(GDHCPClient *dhcp_client, uint8_t *option; char *str; + if (value == NULL || len < 4) + return NULL; + iaid = get_uint32(&value[0]); if (dhcp_client->iaid != iaid) return NULL; @@ -1700,6 +1703,9 @@ static GList *get_dhcpv6_option_value_list(GDHCPClient *dhcp_client, char *str; int i; + if (value == NULL) + return NULL; + switch (code) { case G_DHCPV6_DNS_SERVERS: /* RFC 3646, chapter 3 */ case G_DHCPV6_SNTP_SERVERS: /* RFC 4075, chapter 4 */ |