summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-03-05 11:07:56 +0100
committerIra Cooper <ira@samba.org>2015-03-05 15:59:11 +0100
commit5968310060ddc298835a8ee720ae7fe68aece1b9 (patch)
treee26c209d398004b757465810017ec3af4bac8451
parentfb86aa86ae040dfa8009d4c13f7712fede8bd063 (diff)
downloadsamba-5968310060ddc298835a8ee720ae7fe68aece1b9.tar.gz
perfcount: Fix CID 1274043 Division or modulo by zero
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
-rw-r--r--source3/modules/perfcount_test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/modules/perfcount_test.c b/source3/modules/perfcount_test.c
index c0b53360c72..9ff2d36adcc 100644
--- a/source3/modules/perfcount_test.c
+++ b/source3/modules/perfcount_test.c
@@ -172,6 +172,10 @@ static void perfcount_test_dump_counters(void)
count_mod = lp_parm_int(0, PARM_PC_TEST_TYPE, PARM_DUMPON_COUNT,
PARM_DUMPON_COUNT_DEFAULT);
+ if (count_mod == 0) {
+ return;
+ }
+
if ((count++ % count_mod) != 0)
return;