commit 5994b28542e7f551b71ac471ff9aacf6dcd5a3b0
Author: Jakob Unterwurzacher <jakobunt@gmail.com>
Date:   Sun Feb 5 13:52:48 2017 +0100

    Exit with a fatal error on empty password
    
    The requirement that the password is not empty was not enforced
    properly in all getUserKey() variants. Add the check to makeKey()
    instead that is called in every code path.
    
    This also fixes the crash desribed at https://github.com/vgough/encfs/issues/241 .

diff --git a/encfs/FileUtils.cpp b/encfs/FileUtils.cpp
index 39a3b88..f50d007 100644
--- a/encfs/FileUtils.cpp
+++ b/encfs/FileUtils.cpp
@@ -1348,6 +1348,11 @@ CipherKey EncFSConfig::makeKey(const char *password, int passwdLen) {
   CipherKey userKey;
   std::shared_ptr<Cipher> cipher = getCipher();
 
+  if (passwdLen == 0) {
+    cerr << _("fatal: zero-length passwords are not allowed\n");
+    exit(1);
+  }
+
   // if no salt is set and we're creating a new password for a new
   // FS type, then initialize salt..
   if (salt.size() == 0 && kdfIterations == 0 && cfgType >= Config_V6) {
@@ -1389,10 +1394,12 @@ CipherKey EncFSConfig::getUserKey(bool useStdin) {
   }
 
   CipherKey userKey;
-  if (!res)
-    cerr << _("Zero length password not allowed\n");
-  else
+  if (!res) {
+    cerr << _("fatal: error reading password\n");
+    exit(1);
+  } else {
     userKey = makeKey(passBuf, strlen(passBuf));
+  }
 
   memset(passBuf, 0, sizeof(passBuf));
 
