mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 16:33:31 +00:00
Fix segfault when trying to log into the MP server with an empty password
Probable regression introduced in commit 02ab29d2f19800d28fa10476c48261be1083ad2c (1.13.14). (cherry-picked from commit fc88cdff3b04a77a6de6d3911821cf4e1c7612d6)
This commit is contained in:
parent
0228706f31
commit
e7c0a69420
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user