From 9dfdafc39269fd152247af574e436f024d22c7bf Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 6 Jul 2010 12:44:28 -0500 Subject: Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166 https://bugzilla.redhat.com/show_bug.cgi?id=611790 Resolves: bug 611790 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166 Fix description: Catch possible NULL pointer in send_specific_attrs(). --- ldap/servers/slapd/result.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c index 7c872aaf..8e1e3187 100644 --- a/ldap/servers/slapd/result.c +++ b/ldap/servers/slapd/result.c @@ -1060,7 +1060,7 @@ int send_specific_attrs(Slapi_Entry *e,char **attrs,Slapi_Operation *op,Slapi_PB vattr_flags |= SLAPI_VIRTUALATTRS_ONLY; } - for ( i = 0; attrs[i] != NULL; i++ ) + for ( i = 0; attrs != NULL && attrs[i] != NULL; i++ ) { char *current_type_name = attrs[i]; if(!dontsendattr[i]) { @@ -1130,7 +1130,7 @@ int send_specific_attrs(Slapi_Entry *e,char **attrs,Slapi_Operation *op,Slapi_PB * returned (since it will also trigger the return of the less * generic attribute subtypes. */ - for ( j = i+1; attrs != NULL && attrs[j] != NULL && dontsendattr[i]==0; j++ ) + for ( j = i+1; attrs[j] != NULL && dontsendattr[i]==0; j++ ) { if ( !dontsendattr[j] && slapi_attr_type_cmp( attrs[j], actual_type_name[iter], SLAPI_TYPE_CMP_SUBTYPE ) == 0 ) { -- cgit