Răsfoiți Sursa

609255 - fix coverity Defect Type: Memory - illegal accesses issues

https://bugzilla.redhat.com/show_bug.cgi?id=609255

12210 UNINIT Triaged Unassigned Bug Minor Fix Required
str2entry_fast() ds/ldap/servers/slapd/entry.c

Comment:
ptype is always NULL the first time through the loop, so a will
always be initialized to NULL. But we should explicitly initialize
it to NULL in the declaration.
Noriko Hosoi 15 ani în urmă
părinte
comite
4b2c04ee51
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      ldap/servers/slapd/entry.c

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

@@ -165,6 +165,7 @@ str2entry_fast( const char *rawdn, char *s, int flags, int read_stateinfo )
 	CSN *maxcsn = NULL;
 	char *normdn = NULL;
 	int strict = 0;
+	Slapi_Attr **a = NULL;
 
     /* Check if we should be performing strict validation. */
     strict = config_get_dn_validate_strict();
@@ -206,7 +207,6 @@ str2entry_fast( const char *rawdn, char *s, int flags, int read_stateinfo )
 	while ( (s = ldif_getline( &next )) != NULL &&
 	         attr_val_cnt < ENTRY_MAX_ATTRIBUTE_VALUE_COUNT )
 	{
-		Slapi_Attr **a;
 		char *valuecharptr=NULL;
 #if defined(USE_OPENLDAP)
 		ber_len_t valuelen;