mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 08:29:32 -05:00
Fixed possible fread from a null pointer in HashCache.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8476 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
25acecdf93
commit
b6e0f7c5a4
@ -136,7 +136,12 @@ HashCache::HashCache(const std::string& path)
|
||||
return ;
|
||||
}
|
||||
FILE *F = fopen( (_path+".bin").c_str(),"rb") ;
|
||||
|
||||
if (!F)
|
||||
{
|
||||
std::cerr << "Cannot open file for reading encrypted file cache, filename " << (_path+".bin") << std::endl;
|
||||
free(buffer);
|
||||
return;
|
||||
}
|
||||
if(fread(buffer,1,file_size,F) != file_size)
|
||||
{
|
||||
std::cerr << "Cannot read from file " + _path+".bin" << ": something's wrong." << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user