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

Fix reported crash (seg-fault) in smb_hashstr() due to previous commit

(calling strlen(NULL)).
parent 5f828525
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2012 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
......@@ -232,10 +232,12 @@ hash_t* SMBCALL smb_hashstr(ulong msgnum, uint32_t t, unsigned source, unsigned
if(flags&SMB_HASH_LOWERCASE)
strlwr(p);
}
hash=smb_hash(msgnum, t, source, flags, p?p:str, strlen(p));
FREE_AND_NULL(p);
if(p!=NULL) {
hash=smb_hash(msgnum, t, source, flags, p, strlen(p));
free(p);
} else
hash=smb_hash(msgnum, t, source, flags, str, strlen(str));
return(hash);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment