diff --git a/src/CipherSettings.cpp b/src/CipherSettings.cpp index f7e32155..1a25ae12 100644 --- a/src/CipherSettings.cpp +++ b/src/CipherSettings.cpp @@ -16,7 +16,11 @@ std::string CipherSettings::getPassword() const return sqlb::escapeString(password); } else { // Remove the '0x' part at the beginning - return "\"x'" + password.substr(2) + "'\""; + if (password.length() > 2) { + return "\"x'" + password.substr(2) + "'\""; + } + + return "''"; } }