summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-12-02 21:53:31 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-12-06 11:29:31 +0100
commita0102eed6cdd894fd2b079cfae006e0a62f94777 (patch)
treeb499a7862def6e9608ddfe0f2b45f6a53a3a1764 /src
parentc594c2e6423420c968761b0c95cec57441bbdcf4 (diff)
downloadsssd-a0102eed6cdd894fd2b079cfae006e0a62f94777.tar.gz
sssd-a0102eed6cdd894fd2b079cfae006e0a62f94777.tar.xz
sssd-a0102eed6cdd894fd2b079cfae006e0a62f94777.zip
RESOLV: return ENOENT if the address list is empty
Diffstat (limited to 'src')
-rw-r--r--src/resolv/async_resolv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index 81adf098a..00aed1434 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -1046,6 +1046,14 @@ resolv_gethostbyname_dns_parse(struct gethostbyname_dns_state *state,
ret = ENOMEM;
goto fail;
}
+
+ /* The address list is NULL. This is probably a bug in
+ * c-ares, but we need to handle it gracefully.
+ */
+ if (state->rhostent->addr_list == NULL) {
+ talloc_free(state->rhostent);
+ return ENOENT;
+ }
}
talloc_free(tmp_ctx);