From c0de96f8bd2f64884255f9b0b61a4775ada5e3e6 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Thu, 2 Apr 2015 09:22:31 -0400 Subject: Fixed DNS resolution bug in Windows Due to a bug in unbound, we were passing a string containing a null character to ub_ctx_resolvconf and ub_ctx_hosts rather than a NULL pointer. On *nix this wasn't causing headache, but on Windows this was causing unbound to not correctly load DNS settings from the OS. Note on the bug: in a Windows-specific code branch in the function ub_ctx_hosts(), if the hosts file specified was a NULL pointer, a call to getenv() was stored in a local char* and later freed. This is incorrect, as we do not own that data, and caused the program to crash. --- external/unbound/libunbound/libunbound.c | 1 - 1 file changed, 1 deletion(-) (limited to 'external/unbound') diff --git a/external/unbound/libunbound/libunbound.c b/external/unbound/libunbound/libunbound.c index 91a663a77..af2ca0d30 100644 --- a/external/unbound/libunbound/libunbound.c +++ b/external/unbound/libunbound/libunbound.c @@ -1028,7 +1028,6 @@ ub_ctx_hosts(struct ub_ctx* ctx, const char* fname) "\\hosts"); retval=ub_ctx_hosts(ctx, buf); } - free(name); return retval; } return UB_READFILE; -- cgit v1.2.3