From ff2ba49d02dc99b0c3de5712348ae9d588be7ad7 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 19 Feb 2017 11:06:56 +0100 Subject: Filter coverty false positives Since random is not used for anything cryptographically related, it is fine to use it in those instances. Change-Id: I720172285f60d6bc477c7169c7286fc018ebdf8f BUG: 1424764 Signed-off-by: Michael Scherer Reviewed-on: https://review.gluster.org/16668 Smoke: Gluster Build System Tested-by: Nigel Babu NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- xlators/debug/error-gen/src/error-gen.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/debug/error-gen') diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index b6b17baa87f..103c302d3ba 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -178,6 +178,7 @@ generate_rand_no (int op_no) int rand_no = 0; if (op_no < GF_FOP_MAXVALUE) + /* coverty[DC.WEAK_CRYPTO] */ rand_no = rand () % error_no_list[op_no].error_no_count; return rand_no; } @@ -367,6 +368,7 @@ error_gen (xlator_t *this, int op_no) ret = error_no_list[op_no].error_no[rand_no]; } if (egp->random_failure == _gf_true) + /* coverty[DC.WEAK_CRYPTO] */ egp->failure_iter_no = 3 + (rand () % GF_UNIVERSAL_ANSWER); } return ret; -- cgit