Skip to content

Commit

Permalink
Fix segfault when trying to log into the MP server with an empty pass…
Browse files Browse the repository at this point in the history
…word

Probable regression introduced in commit
02ab29d (1.13.14).

(cherry-picked from commit fc88cdf)
  • Loading branch information
irydacea committed Oct 7, 2018
1 parent 0228706 commit e7c0a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preferences/credentials.cpp
Expand Up @@ -278,7 +278,7 @@ secure_buffer encrypt(const secure_buffer& text, const secure_buffer& key)
secure_buffer decrypt(const secure_buffer& text, const secure_buffer& key)
{
auto buf = rc4_crypt(text, key);
while(buf.back() == 0) {
while(!buf.empty() && buf.back() == 0) {
buf.pop_back();
}
return buf;
Expand Down

0 comments on commit e7c0a69

Please sign in to comment.