Просмотр исходного кода

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 ava_candidates().
Endi S. Dewata 15 лет назад
Родитель
Сommit
5b192173d7
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      ldap/servers/slapd/back-ldbm/filterindex.c

+ 5 - 1
ldap/servers/slapd/back-ldbm/filterindex.c

@@ -194,7 +194,7 @@ ava_candidates(
     Slapi_Value   sv;
     struct berval *bval;
     Slapi_Value   **ivals;
-    IDList        *idl;
+    IDList        *idl = NULL;
     int           unindexed = 0;
     Slapi_Attr    sattr;
 
@@ -251,6 +251,10 @@ ava_candidates(
         case LDAP_FILTER_APPROX:
             indextype = (char*)indextype_APPROX;
             break;
+        default:
+            LDAPDebug( LDAP_DEBUG_TRACE, "<= ava_candidates invalid filter\n", 0, 0, 0 );
+            goto done;
+            break;
     }
 
     /* This code is result of performance anlysis; we are trying to