From: Jeremy Sowden Date: Mon, 5 Jun 2023 15:10:38 +0000 (+0900) Subject: xt_ipp2p: fix Soulseek false positive matches X-Git-Tag: v3.25~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5405db0b7fe9997ffabde40e6e8d11ab53736be2;p=thirdparty%2Fxtables-addons.git xt_ipp2p: fix Soulseek false positive matches According to the comment, the last match attempted is: 14 00 00 00 01 yy 00 00 00 STRING(YY) 01 00 00 00 00 46|50 00 00 00 00 However, the conditional that inspects the last ten bytes is followed by a semicolon, so the printk and return statements are executed regard- less of what the last ten bytes are. Remove the semicolon and only execute the printk and return if the conditional expression is true. Signed-off-by: Jeremy Sowden --- diff --git a/extensions/xt_ipp2p.c b/extensions/xt_ipp2p.c index d11594b..5bdb7ee 100644 --- a/extensions/xt_ipp2p.c +++ b/extensions/xt_ipp2p.c @@ -448,13 +448,13 @@ search_soul(const unsigned char *payload, const unsigned int plen) const unsigned char *w = payload + 9 + y; if (get_u32(w, 0) == 0x01 && (get_u16(w, 4) == 0x4600 || - get_u16(w, 4) == 0x5000) && - get_u32(w, 6) == 0x00) - ; + get_u16(w, 4) == 0x5000) && + get_u32(w, 6) == 0x00) { #ifdef IPP2P_DEBUG_SOUL - printk(KERN_DEBUG "Soulssek special client command recognized\n"); + printk(KERN_DEBUG "Soulseek special client command recognized\n"); #endif - return IPP2P_SOUL * 100 + 9; + return IPP2P_SOUL * 100 + 9; + } } } return 0;