>From 94a84e86020f4590741731192b68c86ec475e19e Mon Sep 17 00:00:00 2001
From: Nathan Kinder <nkinder@redhat.com>
Date: Mon, 7 Dec 2009 09:25:09 -0800
Subject: [PATCH] Bug 195302 - Fix crash regression from previous fix

The previous fix for bug 195302 caused a crash during import.  We
need to check if sdn is NULL before trying to get the dn member
from it in pw_encodevals_ext().
---
 ldap/servers/slapd/pw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index 09bb96c..50136b1 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -350,7 +350,7 @@ pw_encodevals_ext( Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals )
  
 	/* new_passwdPolicy gives us a local policy if sdn and pb are set and
 	   can be used to find a local policy, else we get the global policy */
-   	pwpolicy = new_passwdPolicy(pb, (char*)slapi_sdn_get_ndn(sdn) );
+   	pwpolicy = new_passwdPolicy(pb, sdn ? (char*)slapi_sdn_get_ndn(sdn) : NULL );
 	pws_enc = pwpolicy->pw_storagescheme->pws_enc;
 	delete_passwdPolicy(&pwpolicy);
 
-- 
1.6.2.5

