diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-12-29 12:40:50 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-12-29 12:40:50 -0300 |
commit | 1997ab7cb6994dcc0a48e1247e814a3f76f345e4 (patch) | |
tree | 180f8c509f8c6c7892130a3ca2f86a66e08ed04c /src/login | |
parent | 624dce62fa662ae4ea1c2cc75b60f6ae5385ffe7 (diff) | |
download | hercules-1997ab7cb6994dcc0a48e1247e814a3f76f345e4.tar.gz hercules-1997ab7cb6994dcc0a48e1247e814a3f76f345e4.tar.bz2 hercules-1997ab7cb6994dcc0a48e1247e814a3f76f345e4.tar.xz hercules-1997ab7cb6994dcc0a48e1247e814a3f76f345e4.zip |
[TMW2] SHA256 has fixed width, so force its size and fix reg bug
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/login.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/login/login.c b/src/login/login.c index 07cb42bfd..827d87254 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1036,7 +1036,8 @@ static int login_mmo_auth_new(const char *userid, const char *pass, const char s char *spass; spass = (char *)aMalloc((64+1)*sizeof(char)); md5->sha256(pass, spass); - safestrncpy(acc.pass, spass, sizeof(spass)); + // `sizeof(spass)` was replaced with a fixed width because we use SHA256 + safestrncpy(acc.pass, spass, (64+1)); acc.sex = sex; safestrncpy(acc.email, "a@a.com", sizeof(acc.email)); acc.expiration_time = (login->config->start_limited_time != -1) ? time(NULL) + login->config->start_limited_time : 0; |