mirror of
https://github.com/vgough/encfs.git
synced 2025-04-27 20:58:21 +02: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 );
|
string cyName = rootDir + naming->encodePath( plaintextPath );
|
||||||
//rDebug("openDir on %s", cyName.c_str() );
|
//rDebug("openDir on %s", cyName.c_str() );
|
||||||
|
|
||||||
shared_ptr<DIR> dp( ::opendir( cyName.c_str() ), DirDeleter() );
|
DIR *dir = ::opendir( cyName.c_str() );
|
||||||
if(!dp)
|
if(dir == NULL)
|
||||||
{
|
{
|
||||||
rDebug("opendir error %s", strerror(errno));
|
rDebug("opendir error %s", strerror(errno));
|
||||||
return DirTraverse( dp, 0, shared_ptr<NameIO>() );
|
return DirTraverse( shared_ptr<DIR>(), 0, shared_ptr<NameIO>() );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
shared_ptr<DIR> dp( dir, DirDeleter() );
|
||||||
|
|
||||||
uint64_t iv = 0;
|
uint64_t iv = 0;
|
||||||
// if we're using chained IV mode, then compute the IV at this
|
// if we're using chained IV mode, then compute the IV at this
|
||||||
// directory level..
|
// directory level..
|
||||||
|
Loading…
Reference in New Issue
Block a user