Преглед на файлове

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
Fix description: Catch possible NULL pointer in statechange_post_op().
Endi S. Dewata преди 15 години
родител
ревизия
8d8289f393
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. 3 4
      ldap/servers/plugins/statechange/statechange.c

+ 3 - 4
ldap/servers/plugins/statechange/statechange.c

@@ -262,15 +262,14 @@ static int statechange_post_op( Slapi_PBlock *pb, int modtype )
 			execute = 0;
 
 			/* first dn */
-			if(notify && notify->dn)
+			if(notify->dn)
 			{
 				if(0 != slapi_dn_issuffix(dn, notify->dn))
 					execute = 1;
 			}
 			else
 			/* note, if supplied null for everything in the entry *all* ops match */
-				if(notify)
-					execute = 1;
+				execute = 1;
 
 			if(execute && notify->filter)
 			{
@@ -298,7 +297,7 @@ static int statechange_post_op( Slapi_PBlock *pb, int modtype )
 
 			notify = notify->next;
 		}
-		while(notify != head);
+		while(notify && notify != head);
 	}
 bail:
 	slapi_unlock_mutex(buffer_lock);