diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-07-06 12:44:28 -0500 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 17:08:44 -0700 |
commit | 9dfdafc39269fd152247af574e436f024d22c7bf (patch) | |
tree | c596c3c3982cc3ad12d861b7191810e0406bc54d | |
parent | 5bdd0d0ca1a15bca996d538f075de4943b76598c (diff) | |
download | ds-9dfdafc39269fd152247af574e436f024d22c7bf.tar.gz ds-9dfdafc39269fd152247af574e436f024d22c7bf.tar.xz ds-9dfdafc39269fd152247af574e436f024d22c7bf.zip |
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().
-rw-r--r-- | ldap/servers/slapd/result.c | 4 |
1 files 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 ) { |