Skip to content
Snippets Groups Projects
Commit 1b5883b4 authored by rswindell's avatar rswindell
Browse files

Added memset(0) to smb_hash() (initialize all hash_t fields to zero).

Removed memset(0) from smb_findhash() (fread overwrites anyway).
parent fc17fb92
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,6 @@ int SMBCALL smb_findhash(smb_t* smb, hash_t** compare, hash_t* found_hash, ...@@ -64,7 +64,6 @@ int SMBCALL smb_findhash(smb_t* smb, hash_t** compare, hash_t* found_hash,
rewind(smb->hash_fp); rewind(smb->hash_fp);
while(!feof(smb->hash_fp)) { while(!feof(smb->hash_fp)) {
memset(&hash,0,sizeof(hash));
if(smb_fread(smb,&hash,sizeof(hash),smb->hash_fp)!=sizeof(hash)) if(smb_fread(smb,&hash,sizeof(hash),smb->hash_fp)!=sizeof(hash))
break; break;
...@@ -180,6 +179,7 @@ hash_t* SMBCALL smb_hash(ulong msgnum, ulong t, unsigned source, unsigned flags ...@@ -180,6 +179,7 @@ hash_t* SMBCALL smb_hash(ulong msgnum, ulong t, unsigned source, unsigned flags
if((hash=(hash_t*)malloc(sizeof(hash_t)))==NULL) if((hash=(hash_t*)malloc(sizeof(hash_t)))==NULL)
return(NULL); return(NULL);
memset(hash,0,sizeof(hash_t));
hash->number=msgnum; hash->number=msgnum;
hash->time=t; hash->time=t;
hash->length=length; hash->length=length;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment