summaryrefslogtreecommitdiff
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-05 23:49:15 +0100
commit73ea053bace5c63d61f7b949e5e0bb35f2463cb8 (patch)
tree313e50106f256152e86436bb6b8d784c8b84c000 /src
parenta7b0fa042d58c31140eee6927585c70c18f61584 (diff)
downloadsssd-73ea053bace5c63d61f7b949e5e0bb35f2463cb8.tar.gz
sssd-73ea053bace5c63d61f7b949e5e0bb35f2463cb8.tar.bz2
sssd-73ea053bace5c63d61f7b949e5e0bb35f2463cb8.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 81adf098..00aed143 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);