mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix misc. issues reported by Coverity.
Some uninitialized values, a possible null pointer dereference, and time-of-check-time-of-use on reading random seed file.
This commit is contained in:
parent
50784c64bc
commit
38ae7c98b4
10 changed files with 22 additions and 12 deletions
|
@ -652,16 +652,8 @@ void hmac_md5(size_t size, const unsigned char* bytes, unsigned char digest[16])
|
|||
static bool read_random_seeds(const char* read_file, uint32* seed,
|
||||
uint32* buf, int bufsiz)
|
||||
{
|
||||
struct stat st;
|
||||
FILE* f = 0;
|
||||
|
||||
if ( stat(read_file, &st) < 0 )
|
||||
{
|
||||
reporter->Warning("Seed file '%s' does not exist: %s",
|
||||
read_file, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! (f = fopen(read_file, "r")) )
|
||||
{
|
||||
reporter->Warning("Could not open seed file '%s': %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue