summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-12-02 21:53:31 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-12-05 23:50:47 +0100
commit1d883fb3897ec8457bf44381dcee759992cc0c06 (patch)
treeefe9dfd410e34917e5a619fd99346261590945e7
parent0c0066f07f9a98087fd9fbc8ec52035412526b48 (diff)
downloadsssd-1d883fb3897ec8457bf44381dcee759992cc0c06.tar.gz
sssd-1d883fb3897ec8457bf44381dcee759992cc0c06.tar.xz
sssd-1d883fb3897ec8457bf44381dcee759992cc0c06.zip
RESOLV: return ENOENT if the address list is empty
-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);