Commit 0fbd9806 authored by Simon Kelley's avatar Simon Kelley

Fix compiler warning.

parent 43cdf1c3
...@@ -304,7 +304,7 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source) ...@@ -304,7 +304,7 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source)
/* http://tools.ietf.org/html/draft-vandergaast-edns-client-subnet-02 */ /* http://tools.ietf.org/html/draft-vandergaast-edns-client-subnet-02 */
int len; int len;
void *addrp; void *addrp = NULL;
int sa_family = source->sa.sa_family; int sa_family = source->sa.sa_family;
opt->source_netmask = 0; opt->source_netmask = 0;
...@@ -344,7 +344,7 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source) ...@@ -344,7 +344,7 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source)
len = 0; len = 0;
if (opt->source_netmask != 0) if (addrp && opt->source_netmask != 0)
{ {
len = ((opt->source_netmask - 1) >> 3) + 1; len = ((opt->source_netmask - 1) >> 3) + 1;
memcpy(opt->addr, addrp, len); memcpy(opt->addr, addrp, len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment