From 60339c7f774099c3e497ad18efcd8304324c30c6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 15 Jun 2005 03:06:48 +0000 Subject: [PATCH] ITS#3777 fix scheme comparison --- servers/slapd/overlays/ppolicy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 9941f865dc..af1dd5a153 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -413,12 +413,13 @@ password_scheme( struct berval *cred, struct berval *sch ) for(e = 1; cred->bv_val[e] && cred->bv_val[e] != '}'; e++); if (cred->bv_val[e]) { + int rc; char *sc = ch_calloc( sizeof(char), e + 2); sc[e + 1] = '\0'; /* terminate string */ strncpy( sc, cred->bv_val, e + 1); - e = lutil_passwd_scheme( sc ); + rc = lutil_passwd_scheme( sc ); free( sc ); - if (e && sch) { + if (rc && sch) { sch->bv_val = cred->bv_val; sch->bv_len = e; return LDAP_SUCCESS; -- 2.39.5