mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-20 12:21:37 -05:00
added security to fd management, corrected bug causing bad fseeks
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2651 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dc8978b401
commit
9abbe935b3
@ -431,6 +431,7 @@ bool ftExtraList::loadList(std::list<RsItem *> load)
|
||||
}
|
||||
|
||||
fclose(fd);
|
||||
fd = NULL ;
|
||||
|
||||
if (ts > (time_t)fi->file.age)
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ ftFileProvider::~ftFileProvider(){
|
||||
#endif
|
||||
if (fd!=NULL) {
|
||||
fclose(fd);
|
||||
fd = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,7 +240,7 @@ int ftFileProvider::initializeFileAttrs()
|
||||
* attempt to open file
|
||||
*/
|
||||
|
||||
fd = fopen64(file_name.c_str(), "rb");
|
||||
fd = fopen64(file_name.c_str(), "r+b");
|
||||
if (!fd)
|
||||
{
|
||||
std::cerr << "ftFileProvider::initializeFileAttrs() Failed to open (r+b): ";
|
||||
|
Loading…
Reference in New Issue
Block a user