Netfilter: IRC DCC fixes

Changes to avoid possible crash during
IRC DCC

Change-Id: I4ef43c832fa0bed4aef560f78a39f2aeaee3ab11
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
This commit is contained in:
Ravinder Konka 2015-06-17 21:21:15 +05:30
parent e17e3ab88f
commit 6cf2fc64d2
1 changed files with 7 additions and 4 deletions

View File

@ -150,6 +150,7 @@ static bool mangle_ip(struct nf_conn *ct,
nick_end = nick_start;
while (*nick_end != ' ')
nick_end++;
list_for_each_safe(obj_ptr, prev_obj_ptr,
&client_list.ptr) {
temp = list_entry(obj_ptr,
@ -158,11 +159,13 @@ static bool mangle_ip(struct nf_conn *ct,
*do not mangle the DCC Server IP
*/
if ((temp->server_ip == tuple->dst.u3.ip) &&
(temp->nickname_len == nick_end - nick_start) &&
(memcmp(nick_start, temp->nickname,
temp->nickname_len) == 0))
return false;
(temp->nickname_len == nick_end - nick_start)) {
if (memcmp(nick_start, temp->nickname,
temp->nickname_len) == 0)
return false;
}
}
return true;
}