summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-01-19 13:30:58 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-01-19 18:01:57 +0100
commit8bd9ec3a8885b01a34863d22aa784e221fc422fb (patch)
tree8c4f7e388db1413a6fc37b6c23db105f36f867f0
parent8167761a1e1d7575d49babcea45937fc9cd45fdc (diff)
downloadsssd-8bd9ec3a8885b01a34863d22aa784e221fc422fb.tar.gz
sssd-8bd9ec3a8885b01a34863d22aa784e221fc422fb.tar.xz
sssd-8bd9ec3a8885b01a34863d22aa784e221fc422fb.zip
sdap_connect_send: fail if uri or sockaddr is NULL
Resolves: https://fedorahosted.org/sssd/ticket/2904 Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r--src/providers/ldap/sdap_async_connection.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index ef7a1594..2d9b1184 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -75,6 +75,12 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx,
req = tevent_req_create(memctx, &state, struct sdap_connect_state);
if (!req) return NULL;
+ if (uri == NULL || sockaddr == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "Invalid uri or sockaddr\n");
+ ret = EINVAL;
+ goto fail;
+ }
+
state->reply = talloc(state, struct sdap_msg);
if (!state->reply) {
talloc_zfree(req);