Fix possible null pointer dereference in _client_clan_createinvitereply()
This commit is contained in:
parent
427047a248
commit
e7b81495dd
1 changed files with 5 additions and 0 deletions
|
@ -4916,6 +4916,11 @@ namespace pvpgn
|
|||
}
|
||||
offset = sizeof(t_client_clan_createinvitereply);
|
||||
username = packet_get_str_const(packet, offset, MAX_USERNAME_LEN);
|
||||
if (!username)
|
||||
{
|
||||
eventlog(eventlog_level_error, __FUNCTION__, "[{}] got bad CLAN_CREATEINVITEREPLY packet (bad username)", conn_get_socket(c));
|
||||
return -1;
|
||||
}
|
||||
offset += (std::strlen(username) + 1);
|
||||
if (packet_get_size(packet) < offset + 1) {
|
||||
eventlog(eventlog_level_error, __FUNCTION__, "[{}] got bad CLAN_CREATEINVITEREPLY packet (mising status)", conn_get_socket(c));
|
||||
|
|
Loading…
Reference in a new issue