diff options
author | Haru <haru@dotalux.com> | 2020-05-10 20:35:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-10 20:35:59 +0200 |
commit | 0d66a7243aa6e129cddea4ca09c2616354c23ffa (patch) | |
tree | 56fe416e50f56c2265d72b920efd238538ac22ab /src/char/mapif.c | |
parent | 944d8489f1bcca93e6b2ff06a159084f064dce12 (diff) | |
parent | 66f9a2a1bc2fd509d13729ad6bc586a3b7ad2347 (diff) | |
download | hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.gz hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.bz2 hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.xz hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.zip |
Merge pull request #2705 from Kenpachi2k13/string_var_size
Cap string variable value length and unify corresponding SQL columns size
Diffstat (limited to 'src/char/mapif.c')
-rw-r--r-- | src/char/mapif.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/char/mapif.c b/src/char/mapif.c index 9077afae4..f0c886586 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -2030,7 +2030,8 @@ static int mapif_parse_Registry(int fd) if (count != 0) { int cursor = 14, i; - char key[SCRIPT_VARNAME_LENGTH+1], sval[254]; + char key[SCRIPT_VARNAME_LENGTH + 1]; + char sval[SCRIPT_STRING_VAR_LENGTH + 1]; bool isLoginActive = sockt->session_is_active(chr->login_fd); if (isLoginActive) @@ -2057,8 +2058,8 @@ static int mapif_parse_Registry(int fd) /* str */ case 2: len = RFIFOB(fd, cursor); - safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len)); - cursor += len + 1; + safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len + 1)); + cursor += len + 2; inter->savereg(account_id, char_id, key, index, (intptr_t)sval, true); break; case 3: |