Przeglądaj źródła

pass the string copy to slapi_dn_normalize_original

slapi_dn_normalize_original can modify the argument string, so we cannot
pass in a const char *rawdn to that function - instead, pass in a copy
created by slapi_ch_strdup
Rich Megginson 15 lat temu
rodzic
commit
28a607a6bf
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      ldap/servers/slapd/entry.c

+ 2 - 2
ldap/servers/slapd/entry.c

@@ -264,7 +264,7 @@ str2entry_fast( const char *rawdn, char *s, int flags, int read_stateinfo )
 			if ( NULL == slapi_entry_get_dn_const( e )) {
 				if (flags & SLAPI_STR2ENTRY_USE_OBSOLETE_DNFORMAT) {
 					normdn = 
-						slapi_ch_strdup(slapi_dn_normalize_original(rawdn));
+						slapi_dn_normalize_original(slapi_ch_strdup(rawdn));
 				} else {
 					normdn = slapi_create_dn_string("%s", rawdn);
 					if (NULL == normdn) {
@@ -286,7 +286,7 @@ str2entry_fast( const char *rawdn, char *s, int flags, int read_stateinfo )
 				} else {
 					if (flags & SLAPI_STR2ENTRY_USE_OBSOLETE_DNFORMAT) {
 						normdn = 
-							slapi_ch_strdup(slapi_dn_normalize_original(rawdn));
+							slapi_dn_normalize_original(slapi_ch_strdup(rawdn));
 					} else {
 						normdn = slapi_create_dn_string("%s", rawdn);
 						if (NULL == normdn) {