summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-21 21:29:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-12 13:39:11 +0300
commit3a194659cf80960bacc277683daae00de2c2609e (patch)
tree26ffa29cc4ab2078d9e305f8aa6fdd4097de821c /src/login/login.c
parent14e942fd8f75325c6d073e7b802d2f34f4d09f1d (diff)
downloadhercules-3a194659cf80960bacc277683daae00de2c2609e.tar.gz
hercules-3a194659cf80960bacc277683daae00de2c2609e.tar.bz2
hercules-3a194659cf80960bacc277683daae00de2c2609e.tar.xz
hercules-3a194659cf80960bacc277683daae00de2c2609e.zip
Add missing checks into login.c
Also add some NONNULL attributes for known non null parameters.
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 1fdf2d198..bb8ba51b3 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1230,15 +1230,15 @@ void login_kick(struct login_session_data* sd)
void login_auth_ok(struct login_session_data* sd)
{
- int fd = sd->fd;
+ int fd = 0;
uint32 ip;
-
uint8 server_num, n;
uint32 subnet_char_ip;
struct login_auth_node* node;
int i;
nullpo_retv(sd);
+ fd = sd->fd;
ip = session[fd]->client_addr;
if( runflag != LOGINSERVER_ST_RUNNING )
{
@@ -1431,11 +1431,13 @@ void login_login_error(int fd, uint8 status)
WFIFOSET(fd,23);
}
+void login_parse_ping(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
void login_parse_ping(int fd, struct login_session_data* sd)
{
RFIFOSKIP(fd,26);
}
+void login_parse_client_md5(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
void login_parse_client_md5(int fd, struct login_session_data* sd)
{
sd->has_client_hash = 1;
@@ -1444,6 +1446,7 @@ void login_parse_client_md5(int fd, struct login_session_data* sd)
RFIFOSKIP(fd,18);
}
+bool login_parse_client_login(int fd, struct login_session_data* sd, const char *const ip) __attribute__((nonnull (2)));
bool login_parse_client_login(int fd, struct login_session_data* sd, const char *const ip)
{
uint32 version;
@@ -1523,6 +1526,7 @@ bool login_parse_client_login(int fd, struct login_session_data* sd, const char
return false;
}
+void login_send_coding_key(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
void login_send_coding_key(int fd, struct login_session_data* sd)
{
WFIFOHEAD(fd,4 + sd->md5keylen);
@@ -1532,6 +1536,7 @@ void login_send_coding_key(int fd, struct login_session_data* sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
+void login_parse_request_coding_key(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
void login_parse_request_coding_key(int fd, struct login_session_data* sd)
{
memset(sd->md5key, '\0', sizeof(sd->md5key));
@@ -1541,6 +1546,7 @@ void login_parse_request_coding_key(int fd, struct login_session_data* sd)
login->send_coding_key(fd, sd);
}
+void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) __attribute__((nonnull (2)));
void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status)
{
WFIFOHEAD(fd,3);
@@ -1549,6 +1555,7 @@ void login_char_server_connection_status(int fd, struct login_session_data* sd,
WFIFOSET(fd,3);
}
+void login_parse_request_connection(int fd, struct login_session_data* sd, const char *const ip) __attribute__((nonnull (2, 3)));
void login_parse_request_connection(int fd, struct login_session_data* sd, const char *const ip)
{
char server_name[20];