mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-12 01:09:26 -04: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
2 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue