ldap/servers/slapd/saslbind.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 29611d818044959f60f1319d96f1c08180589dbc
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Sep 16 10:17:31 2015 -0700
Ticket #48279 - Check NULL reference in nssasl_mutex_lock etc. (saslbind.c)
Description: Some SASL subsystem are thread safe and do not require
locking. This may call callbacks in saslbind.c with NULL mutex.
This patch adds NULL checking before calling PR_.*[Ll]ock.
https://fedorahosted.org/389/ticket/48279
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit fba019481012b18818d07eb729469d29cb1a5e5d)
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c
index 1e3e94d..b05c7ae 100644
--- a/ldap/servers/slapd/saslbind.c
+++ b/ldap/servers/slapd/saslbind.c
@@ -35,19 +35,27 @@ void *nssasl_mutex_alloc(void)
int nssasl_mutex_lock(void *mutex)
{
- PR_Lock(mutex);
+ if (mutex) {
+ PR_Lock(mutex);
+ }
return SASL_OK;
}
int nssasl_mutex_unlock(void *mutex)
{
- if (PR_Unlock(mutex) == PR_SUCCESS) return SASL_OK;
- return SASL_FAIL;
+ if (mutex) {
+ if (PR_Unlock(mutex) == PR_SUCCESS) return SASL_OK;
+ return SASL_FAIL;
+ } else {
+ return SASL_OK;
+ }
}
void nssasl_mutex_free(void *mutex)
{
- PR_DestroyLock(mutex);
+ if (mutex) {
+ PR_DestroyLock(mutex);
+ }
}
void nssasl_free(void *ptr)
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org