From ecd45215c70d976aa92b49ddf6eebb5d825af6b7 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 31 Jul 2018 14:13:01 +0200 Subject: [PATCH] disallow empty file when loading shared file list in order to avoid malloc of size 0 --- libretroshare/src/file_sharing/filelist_io.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/file_sharing/filelist_io.cc b/libretroshare/src/file_sharing/filelist_io.cc index a8bb35a9d..baf34f710 100644 --- a/libretroshare/src/file_sharing/filelist_io.cc +++ b/libretroshare/src/file_sharing/filelist_io.cc @@ -194,10 +194,10 @@ bool FileListIO::loadEncryptedDataFromFile(const std::string& fname,unsigned cha { uint64_t file_size ; - if(!RsDirUtil::checkFile( fname,file_size,false ) ) + if(!RsDirUtil::checkFile( fname,file_size,true ) ) { #ifdef FIM_DEBUG - std::cerr << "Encrypted file " << fname << " not available." << std::endl; + std::cerr << "Encrypted file " << fname << " not available or empty." << std::endl; #endif return false; }