perfcount: Fix CID 1035492 Out-of-bounds read
authorVolker Lendecke <vl@samba.org>
Thu, 5 Mar 2015 10:10:35 +0000 (11:10 +0100)
committerIra Cooper <ira@samba.org>
Thu, 5 Mar 2015 14:59:11 +0000 (15:59 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
source3/modules/perfcount_test.c

index 9ff2d36adcc8b503c80efb2dbdd7f98cad37bfdc..c4f7c2e33518265d51b2344cc1c0b687db9312cf 100644 (file)
@@ -69,7 +69,7 @@ static void perfcount_test_add_counters(struct perfcount_test_context *ctxt)
 
                found = false;
 
-               if (ptc->op > MAX_OP)
+               if (ptc->op >= MAX_OP)
                        continue;
 
                for (head = g_list[ptc->op]; head != NULL; head = head->next) {