mirror of
https://github.com/vgough/encfs.git
synced 2024-11-29 03:15:07 +01:00
Fix a segfault when password is zero length.
if useStdin and configMode == Config_Prompt, default to Config_Standard, otherwise we might read the password input at the wrong place.
This commit is contained in:
parent
8d7ce724c9
commit
c3a7da5eff
@ -956,7 +956,9 @@ RootPtr createV6Config(EncFS_Context *ctx,
|
|||||||
const std::string passwordProgram = opts->passwordProgram;
|
const std::string passwordProgram = opts->passwordProgram;
|
||||||
bool useStdin = opts->useStdin;
|
bool useStdin = opts->useStdin;
|
||||||
bool reverseEncryption = opts->reverseEncryption;
|
bool reverseEncryption = opts->reverseEncryption;
|
||||||
ConfigMode configMode = opts->configMode;
|
ConfigMode configMode = (useStdin &&
|
||||||
|
opts->configMode == Config_Prompt) ? Config_Standard
|
||||||
|
: opts->configMode;
|
||||||
bool annotate = opts->annotate;
|
bool annotate = opts->annotate;
|
||||||
|
|
||||||
RootPtr rootInfo;
|
RootPtr rootInfo;
|
||||||
@ -1169,6 +1171,9 @@ RootPtr createV6Config(EncFS_Context *ctx,
|
|||||||
else
|
else
|
||||||
userKey = config->getNewUserKey();
|
userKey = config->getNewUserKey();
|
||||||
|
|
||||||
|
if (userKey == nullptr)
|
||||||
|
return rootInfo;
|
||||||
|
|
||||||
cipher->writeKey(volumeKey, encodedKey, userKey);
|
cipher->writeKey(volumeKey, encodedKey, userKey);
|
||||||
userKey.reset();
|
userKey.reset();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user