summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MySpace/server_con.cpp9
-rw-r--r--MySpace/version.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp
index 94c0cc5..baf506f 100644
--- a/MySpace/server_con.cpp
+++ b/MySpace/server_con.cpp
@@ -183,16 +183,19 @@ void try_login(NetMessage &msg, HANDLE connection) {
char *ch_resp;
mir_sha1_byte_t pw_hash[20];
int ch_resp_size;
- wchar_t wpw[256];
mir_sha1_byte_t key[20];
char email[256];
+ // only use first 10 chars of pw
+ wchar_t wpw[11];
+ wpw[10] = 0;
+
#ifdef _UNICODE
- _tcscpy(wpw, options.pw);
+ _tcsncpy(wpw, options.pw, 10);
WideCharToMultiByte(CP_UTF8, 0, options.email, -1, email, 256, 0, 0);
#else
strcpy(email, options.email);
- MultiByteToWideChar(code_page, 0, options.pw, -1, wpw, 256);
+ MultiByteToWideChar(code_page, 0, options.pw, -1, wpw, 10);
#endif
sha1.sha1_hash((mir_sha1_byte_t*)wpw, wcslen(wpw) * sizeof(wchar_t), pw_hash);
diff --git a/MySpace/version.h b/MySpace/version.h
index 59e6710..5fe886d 100644
--- a/MySpace/version.h
+++ b/MySpace/version.h
@@ -5,7 +5,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 1
-#define __BUILD_NUM 15
+#define __BUILD_NUM 16
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM