mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-20 01:30:42 +01:00
Merge pull request #1936 from rgerhards/cid-185374
omtesting: flag use of rand() function as intentional (for Coverity)
This commit is contained in:
commit
77e1e6b09c
@ -22,7 +22,7 @@
|
||||
* NOTE: read comments in module-template.h to understand how this file
|
||||
* works!
|
||||
*
|
||||
* Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH.
|
||||
* Copyright 2007-2017 Rainer Gerhards and Adiscon GmbH.
|
||||
*
|
||||
* This file is part of rsyslog.
|
||||
*
|
||||
@ -177,6 +177,9 @@ static rsRetVal doSleep(instanceData *pData)
|
||||
static rsRetVal doRandFail(void)
|
||||
{
|
||||
DEFiRet;
|
||||
/* coverity[dc.weak_crypto] -- this is NOT used for security purposes,
|
||||
* so weak PRNG is OK - rgerhards, 2017-10-30
|
||||
*/
|
||||
if((rand() >> 4) < (RAND_MAX >> 5)) { /* rougly same probability */
|
||||
iRet = RS_RET_OK;
|
||||
dbgprintf("omtesting randfail: succeeded this time\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user