Browse Source

Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939

https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in display_index_item().
Endi S. Dewata 15 years ago
parent
commit
1dd2d7417e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      ldap/servers/slapd/tools/dbscan.c

+ 6 - 1
ldap/servers/slapd/tools/dbscan.c

@@ -630,7 +630,12 @@ static void display_index_item(DBC *cursor, DBT *key, DBT *data,
         exit(1);
     }
 
-    if (idl && idl->max == 0) {
+    if (idl == NULL) {
+        printf("\t(illegal idl)\n");
+        return;
+    }
+
+    if (idl->max == 0) {
         /* allids; should not exist in the new idl world */
         if ( allids_cnt == 0 && (display_mode & SHOWSUMMARY)) {
             printf("The following index keys reached allids:\n");