ldap/servers/plugins/posix-winsync/posix-winsync.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 42c3ced7868fc66989d8249d52254c4a46988919
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Feb 9 09:50:15 2015 -0800
Ticket #48001 - ns-activate.pl fails to activate account if it was disabled on AD
Description: commit 345d2c0870d7e8b1005a13cc9cf93865ff0cb53d
introduced a coverity defect - 12989 Dereference after null check.
(cherry picked from commit 9300e96ae0409ea5b6d24b9af0a218ac00c03ecc)
(cherry picked from commit 411a8e7a2a0c2317d20c32ccbf7b801d3a11b80c)
(cherry picked from commit 4488604146ca0fc63853ad5790cb8797c2d95024)
diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync.c
b/ldap/servers/plugins/posix-winsync/posix-winsync.c
index 872abca..446532a 100644
--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
+++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
@@ -133,7 +133,6 @@ enum
* Mostly copied from check_account_lock in the server code.
* Returns: 0 - account is disabled (lock == "true")
* 1 - account is enabled (lock == "false" or empty)
- * -1 - some sort of error
*/
static int
check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
@@ -151,7 +150,9 @@ check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
/* first, see if the attribute is a "real" attribute */
strval = slapi_entry_attr_get_charptr(ds_entry, "nsAccountLock");
if (strval) { /* value is real */
- *isvirt = 0; /* value is real */
+ if (isvirt) {
+ *isvirt = 0; /* value is real */
+ }
rc = 1; /* default to enabled */
if (PL_strncasecmp(strval, "true", 4) == 0) {
rc = 0; /* account is disabled */
@@ -172,7 +173,9 @@ check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
const struct berval *bvp = NULL;
rc = 1; /* default is enabled */
- *isvirt = 1; /* value is virtual */
+ if (isvirt) {
+ *isvirt = 1; /* value is virtual */
+ }
if ((slapi_valueset_first_value(values, &v) != -1) &&
((bvp = slapi_value_get_berval(v)) != NULL)) {
if ((bvp != NULL) && (PL_strncasecmp(bvp->bv_val,
"true", 4) == 0)) {
Show replies by date