diff options
-rw-r--r-- | src/login/login.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/login/login.c b/src/login/login.c index f81ee30c7..7de5dbb76 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1404,7 +1404,7 @@ int parse_login(int fd) } safestrncpy(username, accname, NAME_LENGTH); - safestrncpy(password, token, PASSWD_LEN); + safestrncpy(password, token, min(uTokenLen+1, PASSWD_LEN)); // Variable-length field, don't copy more than necessary clienttype = RFIFOB(fd, 8); } else diff --git a/src/map/script.c b/src/map/script.c index 5b8d459b4..612ca8688 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -610,16 +610,16 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom) { const char *p2; char *arg = NULL; + char null_arg = '\0'; int func; func = script->add_word(p); if( script->str_data[func].type == C_FUNC ){ - char argT = 0; // buildin function script->addl(func); script->addc(C_ARG); arg = script->buildin[script->str_data[func].val]; - if( !arg ) arg = &argT; + if( !arg ) arg = &null_arg; // Use a dummy, null string } else if( script->str_data[func].type == C_USERFUNC || script->str_data[func].type == C_USERFUNC_POS ){ // script defined function script->addl(script->buildin_callsub_ref); |