mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01:00
Merge pull request #243 from ial0/ial_passwd_fix
Fix a segfault when password is zero length.
This commit is contained in:
commit
2e41664562
@ -956,7 +956,9 @@ RootPtr createV6Config(EncFS_Context *ctx,
|
||||
const std::string passwordProgram = opts->passwordProgram;
|
||||
bool useStdin = opts->useStdin;
|
||||
bool reverseEncryption = opts->reverseEncryption;
|
||||
ConfigMode configMode = opts->configMode;
|
||||
ConfigMode configMode = (useStdin &&
|
||||
opts->configMode == Config_Prompt) ? Config_Standard
|
||||
: opts->configMode;
|
||||
bool annotate = opts->annotate;
|
||||
|
||||
RootPtr rootInfo;
|
||||
@ -1169,6 +1171,9 @@ RootPtr createV6Config(EncFS_Context *ctx,
|
||||
else
|
||||
userKey = config->getNewUserKey();
|
||||
|
||||
if (userKey == nullptr)
|
||||
return rootInfo;
|
||||
|
||||
cipher->writeKey(volumeKey, encodedKey, userKey);
|
||||
userKey.reset();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user