Skip to content

Commit 1e77bc7

Browse files
committed
CipherSettings: fix crash with empty RawKey
Fix crash when CipherSettings::getPassword() is called with empty RawKey. Related issue #2743
1 parent 3af4c3d commit 1e77bc7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/CipherSettings.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ std::string CipherSettings::getPassword() const
1616
return sqlb::escapeString(password);
1717
} else {
1818
// Remove the '0x' part at the beginning
19-
return "\"x'" + password.substr(2) + "'\"";
19+
if (password.length() > 2) {
20+
return "\"x'" + password.substr(2) + "'\"";
21+
}
22+
23+
return "''";
2024
}
2125
}
2226

0 commit comments

Comments
 (0)