mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01:00
fix potential null pointer exception in opendir handler
git-svn-id: http://encfs.googlecode.com/svn/trunk@41 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
parent
c79ef046d7
commit
dcbd57ecd0
@ -393,13 +393,15 @@ DirTraverse DirNode::openDir(const char *plaintextPath)
|
||||
string cyName = rootDir + naming->encodePath( plaintextPath );
|
||||
//rDebug("openDir on %s", cyName.c_str() );
|
||||
|
||||
shared_ptr<DIR> dp( ::opendir( cyName.c_str() ), DirDeleter() );
|
||||
if(!dp)
|
||||
DIR *dir = ::opendir( cyName.c_str() );
|
||||
if(dir == NULL)
|
||||
{
|
||||
rDebug("opendir error %s", strerror(errno));
|
||||
return DirTraverse( dp, 0, shared_ptr<NameIO>() );
|
||||
return DirTraverse( shared_ptr<DIR>(), 0, shared_ptr<NameIO>() );
|
||||
} else
|
||||
{
|
||||
shared_ptr<DIR> dp( dir, DirDeleter() );
|
||||
|
||||
uint64_t iv = 0;
|
||||
// if we're using chained IV mode, then compute the IV at this
|
||||
// directory level..
|
||||
|
Loading…
Reference in New Issue
Block a user