[Date Prev][Date Next] [Chronological] [Thread] [Top]

Return value not properly checked in sasl.c (ITS#3311)



Full_Name: Guus Leeuw
Version: HEAD
OS: Linux RH 9 (Psyche)
URL: 
Submission from: (NULL) (212.43.204.103)


The return value from sasl_auxprop_add_plugin() is not checked.

Here is the patch against HEAD:

Index: sasl.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/sasl.c,v
retrieving revision 1.203
diff -i -w -u -r1.203 sasl.c
--- sasl.c	19 Jul 2004 22:32:43 -0000	1.203
+++ sasl.c	30 Aug 2004 05:35:29 -0000
@@ -1075,7 +1075,16 @@
 #if SASL_VERSION_MAJOR >= 2
 	generic_filter.f_desc = slap_schema.si_ad_objectClass;
 
-	sasl_auxprop_add_plugin( "slapd", slap_auxprop_init );
+	rc = sasl_auxprop_add_plugin( "slapd", slap_auxprop_init );
+	if( rc != SASL_OK ) {
+#ifdef NEW_LOGGING
+		LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: init failed.\n", 0, 0, 0);
+#else
+		Debug( LDAP_DEBUG_ANY, "slap_sasl_init failed\n");
+#endif
+
+		return -1;
+	}
 #endif
 	/* should provide callbacks for logging */
 	/* server name should be configurable */