diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-09-15 14:18:17 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-12-09 20:14:31 +0100 |
commit | d164404a2c5d6d5254b96567c7cda5e78a47f8bb (patch) | |
tree | 1dc3fddb84b5d9fd3144f4592d949667ca8d4b3b | |
parent | efe95361859b688e154165af3d7759aeb9609cb6 (diff) | |
download | sssd-d164404a2c5d6d5254b96567c7cda5e78a47f8bb.tar.gz sssd-d164404a2c5d6d5254b96567c7cda5e78a47f8bb.tar.xz sssd-d164404a2c5d6d5254b96567c7cda5e78a47f8bb.zip |
LDAP: Do not clobber return value when multiple controls are returned
We loop over the array of returned controls and set 'ret' based on the
control value. In case multiple controls were returned, the 'ret'
variable might be clobbered with result of a string-to-int conversion.
Reviewed-by: Pavel Reichl <preichl@redhat.com>
(cherry picked from commit 6a3ec7ba6f99b027c4c15a360ef0116fe60a0705)
-rw-r--r-- | src/providers/ldap/sdap_async_connection.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index af4a2aa63..9019cff9f 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -851,12 +851,13 @@ static void simple_bind_done(struct sdap_op *op, goto done; } state->ppolicy->expire = strtouint32(nval, NULL, 10); - ret = errno; + lret = errno; talloc_zfree(nval); - if (ret != EOK) { + if (lret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, "Couldn't convert control response " - "to an integer [%s].\n", strerror(ret)); + "to an integer [%s].\n", strerror(lret)); + ret = ERR_INTERNAL; goto done; } |